Questions tagged [computation-expressions]
The computation-expressions tag has no summary.
10 questions
1
vote
2
answers
353
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 ...
1
vote
7
answers
782
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 ...
2
votes
1
answer
304
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:
...
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 ...
0
votes
1
answer
72
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
1
answer
20k
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
1
answer
105
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
1
answer
470
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
1
answer
269
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 ...
6
votes
3
answers
2k
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 ...