Dan Sugalski <[EMAIL PROTECTED]> wrote
> >my $x = 1;
> >{
> >     my $x = 2;
> >     delete $MY::{'$x'};
> >     print $x;
> >     $mysub = sub {$x};
> >}
> >
> >print $mysub->();
> >
> >People seem agreed that print $x should do the equivalent of
> >         throw "lexical '$x' no longer in scope"
> 
> There might be less agreement than you might think. I wouldn't consider it 
> unreasonable to search outward until I found a $x. (Perhaps going so far as 
> to find a global if there were no lexical $x around)
> 
> >rather than printing 1, but what should print $mysub->() do?
> 
> Whatever inside would do, either throwing the error or walking out. I can 
> see either way.

In either case, do people think that the behaviour should be consistent,
ie both walk or both throw?

I'm in favour walking, as long as we can get it so the walk is a one-off
fixup at delete time, and that any further accesses still just do the Perl 6 
equivalent of

PL_curpad[PL_op->op_targ]

Reply via email to