moritz (>): > On Rakudo 2010.12: > > use v6; > sub f($x) { > multi return($nv) { > nextwith($nv /2); > } > > return $x; > } > say f 6 > > I'd expect that to output 3\n, but instead I get > > Null PMC access in clone() > in 'return' at line 1 > in 'f' at line 7:test.pl > in main program body at line 9:test.pl > > which is sad, because it prevents me from using a "neat" and evil trick.
<masak> rakudo: my &r := &return; sub f { my sub return($v) { say "LOL!"; &r($v + 10) }; return 42 }; say f <p6eval> rakudo 9b8bad: OUTPUT«LOL!52» <masak> wow! that *works*! <masak> moritz_! :D <masak> moritz_: I have a workaround for one of your RT tickets. * masak adds it to that ticket <moritz_> masak: I have too. I just name the new return differently :-) <masak> now you don't have to :)