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

Re: [perl #80306] Quoting behaviour of => is too generous

Thread Previous | Thread Next
From:
Ed Avis
Date:
December 6, 2010 08:33
Subject:
Re: [perl #80306] Quoting behaviour of => is too generous
Message ID:
loom.20101206T172901-553@post.gmane.org
Abigail <abigail <at> abigail.be> writes:

>>  $ perl -MO=Deparse -wce 'my %h = ("-aa" => 1)'

>I don't know what your point with this example is.

Sorry - stupidity on my part.  Of course it is already quoted.

>>It's a bit odd for the quoting behaviour to differ like this - or at least, I
>>would expect that if => has the effect of quoting its LHS, then it should also
>>bind to it a bit more tightly.
>
>Sorry, no idea what you mean here.

I might expect

   12 -aa => 1

to be equivalent to

   12 - (aa => 1)

So that if => is quoting just the 'aa' part, and not '-aa', then it should
also bind to just the 'aa' part.  On the other hand, if - binds more tightly than
=>, then => should not have any special quoting effect because its LHS is not
a plain string but the seeming expression (12 - aa).

-- 
Ed Avis <eda@waniasset.com>


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