in reply to Re^32: Why is the execution order of subexpressions undefined? (magic ruts)
in thread Why is the execution order of subexpressions undefined?
What if f(), g() and h() get their values from arrays (or external sources) in lockstep? Ie. each call returns the next value from it's respective source.
The compiler arbitrarially opts to not call some of those functions when one of them returns 0, all subsequent calculations are wrong because the sequences are no longer in step. Is 0 a second class number?
So now the only way to avoid the compiler subverting what the programmer know he needs is for the programmer to play hostage to the compiler and code:
my $temp1 = f(a); my $temp2 = g(b); my $temp3 = h(c); my $result = ($temp1 + $temp2) * $temp3;
You call that an optimisation? That is so ludicrous as to be laughable, except it is where thing stand right now--and, on the basis of majority opinion in this thread, the way it is likely to be in the future. No that is laughable!
|
|---|