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. (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

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?

- Ken

Reply via email to