nqp
nqp copied to clipboard
No $*CALLER::FOO
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.
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.