Field assignments are reordered in record creations
Wed May 24 17:14:48 CEST 2006
So what is ,? Can I not depend on an expression prior to a , being
evaluated before something after the ,?
What about ; in guard statements?
Is it the same idea, simply not called a sequence point? Or is the
idea not existent?
On May 24, 2006, at 9:59 AM, David Hopwood wrote:
> David Hopwood wrote:
>> orbitz@REDACTED wrote:
>>> I don't believe what is happen is what you think is happening. The
>>> issue is that the order of execution in a single sequence point
>>> is not
>>> defined. Your code does no say anything about which record
>>> fields gets
>>> assigned first, simply which function gets executed first. You
>>> depend on the order of execution of an expression to reflect how
>>> wrote it. Compilers are generally free to execute expressions in
>>> whatever order is easiest for them.
>> Erlang is not C; it has no concept of sequence points. However,
>> correct that the evaluation order of arguments to an operator or
>> call is undefined. See section 6.3 of
> Sorry, that's Core Erlang. The corresponding statement in the Erlang
> reference manual is in section 6.5 of <http://citeseer.ist.psu.edu/
> David Hopwood <david.nospam.hopwood@REDACTED>
More information about the erlang-questions