in reply to Re: Re: Re: Re: An obscure side effect?
in thread An obscure side effect?
Postincrement and postdecrement also have associativity and precedence (although their associativity is "nonassoc", since they're unary), but their order of execution is still undefined when used multiple times in the same statement.
My point is that I don't believe that associativity or precedence guarantee order of execution. For example, addition and multiplication have well-known associativity and precedence, but in the expression
I don't believe the order in which a, b, or c will be executed is guaranteed, since, ignoring side-effects, they can be evaluated in many different orders to produce correct results. At least, I haven't been able to find such a guarantee in Perl's documentation; if you can point me to one with some degree of precision I'd be happy to change my mind.$a = b()*c() + d()
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: An obscure side effect?
by Aristotle (Chancellor) on Aug 05, 2003 at 13:58 UTC |