Carl (>): > Rakudo r35404 doesn't work according to spec in the area of 'state' > variables and cloned blocks. > > $ perl6 -e 'my $i = 0; my $func = { state $x = $i++; say $x }; my ($a, > $b) = $func.clone, $func.clone; $a(); $b(); $a()' > 0 > 1 > 2 > > According to S04, this should be equivalent to > > $func = { state $x will start { $x = $i++ }; say $i };
Arrgh, that should be 'say $x', of course. > and thus (in my understanding) produce > > 0 > 1 > 1