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

Re: maint-5.10 snapshot (aka "RC0")

Thread Previous | Thread Next
From:
Vincent Pit
Date:
July 8, 2009 01:03
Subject:
Re: maint-5.10 snapshot (aka "RC0")
Message ID:
4A5452DA.7010506@profvince.com

> Maybe this optimisation :
>
> [rafael@scipion ~]$ perl5.10.0 -MO=Deparse -e 'if(not $a or not $b){}'
> if (not $a or not $b) {
>     ();
> }
> -e syntax OK
> [rafael@scipion ~]$ bleadperl -MO=Deparse -e 'if(not $a or not $b){}'
> unless ($a and $b) {
>     ();
> }
> -e syntax OK
>
> Which seems to come from :
>
> commit edbe35ea95baf286c38bf4d7db7d18b82ecce254
> Author: Vincent Pit <perl@profvince.com>
> Date:   Sat Aug 30 00:47:28 2008 +0200
>
>     Re: unless(...) terser than if(!...)
>     Message-ID: <48B86060.4090905@profvince.com>
>
>     p4raw-id: //depot/perl@34310
>
> Not sure Deparse will be able to cope with this.

This is highly possible.

If by cope you mean "being able to recreeate the precise original
code", then I don't think so either. But it also can't tell the
difference between "1 if $x" and "$x and 1", or recover optimized out
sections, so that shouldn't be a blocker.

Vincent.


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