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

Re: [perl #76438] peephole optimiser could prune more dead code

Thread Previous | Thread Next
From:
Eric Brine
Date:
July 12, 2010 14:12
Subject:
Re: [perl #76438] peephole optimiser could prune more dead code
Message ID:
AANLkTinfRQagaFU54E4VyuXl8g15T88zmRzE1881_uyc@mail.gmail.com
On Mon, Jul 12, 2010 at 7:07 AM, David Golden <xdaveg@gmail.com> wrote:

> I said "... have side effects when evaluated ..." but your example has
> a side effect (functional call) in an assignment before the logic
> expression.


I realise you knew it would break. What I was pointing out is that it breaks
a common idiom. "or" and "and" are used for flow control all over in my
code. You're suggesting we can no longer count on the argument evaluation
order of logical operators. It has long been documented that "the right
expression is evaluated only if the left expression is false.", but your
suggestion is to evaluate the RHS first if it's constant. It would change
the function of a fundemental operator.

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