develooper Front page | perl.perl6.internals | Postings from July 2002

Re: [perl #15800] [PATCH] lexical scope ops, test and example

Thread Previous
Dan Sugalski
July 30, 2002 10:51
Re: [perl #15800] [PATCH] lexical scope ops, test and example
Message ID:
At 11:01 AM -0600 7/30/02, Jonathan Sillito wrote:
>Thanks for the correction. May I ask about the find_lex op? In my
>implementation it looks back through the stack of pads for the given

One thing we need to add is a constant type to initialize pads. It's 
perfectly acceptable, and in fact a design goal, to have a PMC in 
multiple pads with the same name.

So, for example, if you had:

    my $foo;
       my $bar;
       $foo = 12;

at the perl level, there'd be two pads, one for the block and one for 
the outer scope. The PMC for $foo would be in *both* of them, and the 
lookup wouldn't go past the inner pad. (And the lookup would be by 
number rather than name as well, since we know the position in the 
pad of the lexical)

>Also, should open_lex/close_lex be named new_pad/close_pad instead?

Yeah, I think so. Or new_pad/pop_pad, since we may keep the pad 
around when we take it off the current pad stack.

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai                         have teddy bears and even
                                       teddy bears get drunk

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