in reply to Re^37: Why is the execution order of subexpressions undefined? (magic ruts)
in thread Why is the execution order of subexpressions undefined?

Hmm. I though lazy evaluation meant that the value wasn't calculated until needed.
Indeed. So, if you have:
result = f(a) * g(b) + h(c);
and f(a) returns 0, there's no need to call g(). (Or, if you're doing Inf and NaN arithmetic, there's no need to call g() if f(a) returns NaN).
if the compiler took it upon itself to override my explicit request to call it.
If you have lazy evaluation, there's no explicit request to call anything!
  • Comment on Re^38: Why is the execution order of subexpressions undefined? (magic ruts)
  • Download Code