On Fri Nov 14 05:58:21 2008, pmichaud wrote:
> On Thu, Nov 13, 2008 at 03:21:45PM -0800, Carl Mäsak wrote:
> > Rakudo r32629 sometimes dies when assigning a readonly variable to
> > itself, and sometimes not.
> > 
> > $ ./perl6 -e 'for <a b c> -> $foo { $foo = $foo; say $foo }' # dies,
good
> > Cannot assign to readonly variable.
> > [...]
> > 
> > $ ./perl6 -e 'for split(/<sp>/, "a b c") -> $foo { $foo = $foo; say
> > $foo }' # baaaahd!
> > a
> > b
> > c
> 
> There's a bit more going on behind the scenes here -- the "$foo = $foo"
> line in the second case is also promoting Parrot String values into
> Rakudo Str objects.  I suspect that promotion is causing the
> readonly property on $foo to be lost.
> 
> My guess is that we want to adjust Parrot's C<copy> opcode so that
> it doesn't modify the destination PMC's properties.
> 
I've fixed it in a patch that's about to go in as soon as it smokes;
please can somebody make sure that a regression test goes in for this.

Thanks,

Jonathan

Reply via email to