On Mon May 03 04:20:44 2010, moritz wrote:
> Am 03.05.2010 12:30, schrieb Mark J. Reed:
> > Huh?  Those are explicitly read-write.  Why is it dying at all?
> 
> Yes. I think masak++ picked up the wrong lines from p6eval:
> 
> <@moritz_> rakudo: sub swap($a, $b) { ($a, $b) = ($b, $a) }; swap my
> $z
> = 2, my $y = 5;
> <+p6eval> rakudo c4857a:  ( no output )
> 
> *this* should die.
> 
> > On Sat, May 1, 2010 at 9:17 AM, Carl M�sak<perl6-bugs-
> follo...@perl.org>wrote:
> >
> >> # New Ticket Created by  "Carl M�sak"
> >> # Please include the string:  [perl #74820]
> >> # in the subject line of all future correspondence about this
> issue.
> >> #<URL: http://rt.perl.org/rt3/Ticket/Display.html?id=74820>
> >>
> >>
> >> <moritz_>  rakudo: sub swap($a is rw, $b is rw) { ($a, $b) = ($b,
> $a)
> >> }; swap(3, 4) # should that die?
> >> <p6eval>  rakudo c4857a:  ( no output )
> >> <moritz_>  I'm quite sure it should :/
> >> <masak>  aye, me too.
> >> * moritz_ predicts masak's next line
> >> * masak does the thing that fulfills that prediction
> >> <masak>  rakudo: sub foo($a is rw) { $a = 5 }; foo(42)
> >> <p6eval>  rakudo c4857a: OUTPUT�Cannot assign to readonly value
> >> <masak>  rakudo: (1, 2) = 3, 4
> >> <p6eval>  rakudo c4857a:  ( no output )
> >> <masak>  ok, so it's the list assignment that doesn't pick up on
> non-rw
> >> values.
> >>
> >
> >
> >
> 

And now it does:


$ ./perl6 foo -e 'sub swap($a, $b) { ($a, $b) = ($b, $a) }; swap my $z = 2, my 
$y = 5;'
Cannot assign to a readonly variable or a value
  in method STORE at src/gen/CORE.setting:3369
  in sub swap at foo:1
  in sub swap at foo:1
  in <anon> at foo:1
  in <anon> at foo:1

tests needed.

-- 
Will "Coke" Coleda

Reply via email to