nqp icon indicating copy to clipboard operation
nqp copied to clipboard

No $*CALLER::FOO

Open Benabik opened this issue 14 years ago • 1 comments

I attempted to write the following:

    my $old := $*VAR;
    my $*VAR := 'new value';

To my surprise, $old ended up undefined due to $_VAR being declared at ENTER time. I am informed that $_CALLER::VAR would do what I wanted, so an implementation of that would be very useful.

Benabik avatar Jun 07 '11 22:06 Benabik

This is still an issue on latest NQP.

This happens because we store all declarations as the first thing in a block, which means that the old $*VAR is masked as soon as we enter a block. I tried a quick fix, but it didn't work sadly.

arnsholt avatar Oct 06 '13 09:10 arnsholt