Questions tagged [computation-expressions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
7answers
445 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 ...
1
vote
1answer
69 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: ...
11
votes
5answers
3k 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 ...
0
votes
1answer
50 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 = ...
5
votes
1answer
11k 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 (...
3
votes
1answer
72 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 ...
1
vote
1answer
426 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 ...
0
votes
1answer
214 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 ...
4
votes
3answers
967 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 ...