develooper Front page | perl.perl6.language | Postings from March 2006

S06 Splicing clarification

Thread Next
Brad Bowman
March 10, 2006 05:55
S06 Splicing clarification
Message ID:

S06/Splicing finishes with:

 A quasiquote is not a block (even if the delimiters are curlies),
 so any declaration of a variable is taken to be part of the block 
 surrounding the macro call location. Add your own {...} if you want 
 a block to surround your declarations.

I read this as meaning that

 macro M () { return q:code { my $x } };

would add a lexical $x to the scope of M's caller.  This seems unhygienic
and against the spirit of the "my $COMPILING::x" in earlier versions of S06. 

Regardless of the "not a block" status of a q:code, I think that it's
lexicals should only be visible within the q:code by default.  If this is 
the intention of the above phrase the it should be made clearer.


... There is dignity in paucity of words. ... -- Hagakure

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About