At 09:26 PM 9/10/2001 -0400, Ken Fox wrote:
>Dan Sugalski wrote:
> >    jump FOO
> >
> > doesn't change scope.
> >
> >    newscope scope_template_in_fixup_section
> >
> > does. And
> >
> >    exitscope
> >
> > leaves one. :)
>
>Ok. That clears it up a little. The current scope is part of
>the VM internal state and compilers need to generate state
>change instructions if they use lexicals.

Yes. More to the point only if they need to have a new set of lexicals. 
We'll probably have scopeless subs.

>(Actually, I hope
>they only need state change instructions if they need the
>scope's symbol table...)
>
>Just to check my understanding, Perl 6 will compile
>
>   { bar { foo } blah }
>
>into
>
>    newscope
>    bar
>    newscope
>    foo
>    exitscope
>    blah
>    exitscope

Something like that, yes.

>What happens with:
>
>    goto FOO; { bar { FOO: foo } blah }
>
>Is goto responsible for figuring out it has entered bar's
>scope and setting the VM state so that the exitscopes are
>properly balanced?

I'm not sure what we'll do in that situation. gotos into scopes might not 
be allowed.

                                        Dan

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

Reply via email to