in reply to Re^2: Why is the execution order of subexpressions undefined? (victim)
in thread Why is the execution order of subexpressions undefined?

Under an "as-if" rule, a bytecode optimizer need not obey the precedence rules, but the initial interpretation of your source must. Precedence and associativity are there to ensure that the expression you write is the one that gets calculated.

After Compline,
Zaxo

  • Comment on Re^3: Why is the execution order of subexpressions undefined? (victim)

Replies are listed 'Best First'.
Re^4: Why is the execution order of subexpressions undefined? (victim)
by tye (Sage) on Apr 12, 2005 at 05:35 UTC

    We are talking order. The order that the calculations get performed need not be as you specified (based solely on precedence and associativity). Even if + might be redefined by the programmer such that x+y != y+x, computing x+y does not require that x be computed before y.

    - tye