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

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

Thread Previous | Thread Next
Vincent Pit
August 29, 2008 13:47
Re: unless(...) terser than if(!...)
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About