Skip to main content

Questions tagged [computation-expressions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
312 views

How to concat lists with logical ANDs and ORs

Having multiple lists of integers, like e.g.: var p1 = new[] { 3, 9, 5, 8, 9 }; var p2 = new[] { 12, 1, 18, 27, 103, 99, 4 }; var p3 = new[] { 23, 930, 15 }; // ... I want to concatenate them with ...
Uwe Keim's user avatar
  • 347
1 vote
7 answers
714 views

Is the sum or subtraction of two positive machine numbers exact?

If you have two positive numbers that can be represented exactly by the finite arithmetic of your computer, that is, two machine numbers, if you perform their sum or subtraction with perfect ...
elcocodrilotito's user avatar
2 votes
1 answer
273 views

Functional Approaches to Serializing Objects to Variable-length Byte Array Output

I have a large number of record types derived from a binary format specification. So far, I've already written a computation expression builder that let’s me read structures from the files easily: ...
Kevin Li's user avatar
  • 145
12 votes
5 answers
4k views

When is short-circuit evaluation bad?

To be a bit more clear, I'll state that I've spent lots of time with different languages. But until now it's been either it'll use it all the time or it doesn't support it at all. Now work has me ...
Kit Ramos's user avatar
  • 231
0 votes
1 answer
54 views

When should an expression tree hold pointers and when should it hold values of subexpressions?

I was thinking it should hold pointers: struct Expr { string sym; Expr*[] sub; this(self, string sym) { this.sym = sym; } @property auto dup() const { auto e = ...
HighAsAKiteOnMath's user avatar
5 votes
1 answer
19k views

Alternative for eval() in javascript for expression evaluation

I'm looking at the alternative that can substitute the use of eval() and new Function() javascript techniques. I'm developing a solution build with javascript and the platform on which it is built (...
Maciek Simm's user avatar
3 votes
1 answer
93 views

Handling continuations within a priority queue

I am attempting to determine the best way to handle actions that must occur in passes. Many of these actions use objects that were created in a previous pass. The solution I have come up with is to ...
MI3Guy's user avatar
  • 250
1 vote
1 answer
450 views

Using streams to connect programming languages

I'm trying to run a computation-heavy program that creates an image on a website. Is it possible to compute in C++ and have an output stream that connects to an input stream in Node.js to display an ...
user939687's user avatar
0 votes
1 answer
250 views

Big O notation for the algorithm

What would be the big o for the algo: for (i=0; i < n*n; i++) for(j=0; j<i*i; j++) As per my understanding 1st loop will loop upto n2 times. 2nd loop will go around n2 times. Am I right or ...
new's user avatar
  • 3
6 votes
3 answers
1k views

Is there a way to created nested computation expressions?

In F#, I want to build a hierarchical data structure in a way with a minimum amount of language noise. The actual problem is trying to build an RSpec inspired framework using F#. RSpec allows the ...
Pete's user avatar
  • 8,966