Evaluation order

bearophile bearophileHUGS at lycos.com
Wed Feb 24 14:52:34 PST 2010


Walter Bright:
> All compiler behavior is based on what the observer sees. If the 
> compiler can rearrange things in a manner that the observer cannot 
> detect, then the rearrangement is allowed.

OK. But if the language turns putting impure expressions inside a function call into a compile time error, allowing only pure expressions inside function calls, then the compiler can always be free to rearrange those expressions, and there's both no performance penalty and the programmer can be certain there is no performance penalty. I guess you are not interested in this idea.

Bye,
bearophile



More information about the Digitalmars-d mailing list