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

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

Thread Previous | Thread Next
Eric Brine
July 12, 2010 14:12
Re: [perl #76438] peephole optimiser could prune more dead code
Message ID:
On Mon, Jul 12, 2010 at 7:07 AM, David Golden <> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About