develooper Front page | perl.perl5.porters | Postings from March 2001

Re: ~~, was Re: [FWP] Shortest scalarizer?

Thread Previous | Thread Next
From:
abigail
Date:
March 30, 2001 13:29
Subject:
Re: ~~, was Re: [FWP] Shortest scalarizer?
Message ID:
20010330213355.32743.qmail@foad.org
On Fri, Mar 30, 2001 at 08:26:08PM +0100, Simon Cozens wrote:
> On Fri, Mar 30, 2001 at 12:19:01PM -0500, Steve Lane wrote:
> > Bernie Cosell wrote:
> > > So I tried to find something shorter and less obtrusive to
> > > 'scalarize' the arg.
> > 
> > $ perl -le 'print ~~localtime'
> > Fri Mar 30 12:18:03 2001
> 
> Neat, but I wonder whether the peephole optimizer shouldn't optimize ~~ away.
> Would we lose any semantics that way? (I think the above would still work
> because optimization happens after context propagation.)

This holds:

    defined ~~undef


Abigail

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