Don't ask to ask, just ask | |
PerlMonks |
Re^10: eval order of args to a subby shmem (Chancellor) |
on Jun 05, 2007 at 09:49 UTC ( [id://619330]=note: print w/replies, xml ) | Need Help?? |
You are both right, mrpeabody and ikegami - it's not in the specs; but my take on this is
that in the expression
the term 8 - 4 is a subexpression and the operand for the rightmost substraction operation; from that I deduce that associativity therefore defines the operand and subexpression evaluation order. That might be a logical fallacy; which one, I wonder? Anyways, that's how perl does it, although it is not defined in Perl. Of course the implementation could change, and perl could do a breadth-first evaluation of its execution tree and roll a dice for ad-hoc definition of evaluation order. But the optimizer would set things straight again, I guess :-) --shmem
In Section
Seekers of Perl Wisdom
|
|