develooper Front page | perl.perl5.porters | Postings from July 2010

Re: Order of evaluation of terms (was peephole optimiser could prune more dead code)

Thread Previous | Thread Next
From:
David Golden
Date:
July 15, 2010 13:12
Subject:
Re: Order of evaluation of terms (was peephole optimiser could prune more dead code)
Message ID:
AANLkTiniGMYdnZoJMldr3KSojErHS-Me4fBRJhjffyt9@mail.gmail.com
On Thu, Jul 15, 2010 at 3:43 PM, Jan Dubois <jand@activestate.com> wrote:
> On Thu, 15 Jul 2010, Jan Dubois wrote:
>> On Thu, 15 Jul 2010, David Golden wrote:
>> Precedence and associativity are all about how the parser would insert
>> parenthesis into an expression to disambiguate its meaning; it does not
>> for example change the commutative property of addition: (a + b) has to
>> be the same as (b + a), otherwise the operation is no longer an addition.
>
> Please ignore the part about the commutative property. While true, it is
> unrelated to the rest of the argument in that post.  Sorry about that.

I was amusedly thinking that it's not guaranteed to hold true when
"evaluating" "a" and "b" have magic anyway.  (e.g. "a" is tied to
increment when evaluated and "b" is tied to do something as a function
of a.

And then we come full circle to the debate that spawned this thread
about what can be assumed about order of evalution.  :-)

-- David

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About