develooper Front page | perl.perl5.porters | Postings from August 2008

Re: unless(...) terser than if(!...)

Thread Previous | Thread Next
From:
Vincent Pit
Date:
August 29, 2008 13:47
Subject:
Re: unless(...) terser than if(!...)
Message ID:
48B86060.4090905@profvince.com
As requested by Rafael, I added some overloading and deparse tests. I
also added a few basic tests.

While testing, I realized that the "if (!$x)" wasn't optimized if it was
the last statement of a sequence. But it's actually the good thing,
because "do { 1 unless $x }" and "do { 1 if not $x }" actually don't
return the same thing when $x is true.

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