On Sun Jan 11 04:59:51 2009, masak wrote:
> 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 };
> 
> and thus (in my understanding) produce
> 
> 0
> 1
> 1

Actually expected output is:

0
1
0

Or at least I talked at least two other people into #perl6 into agreeing
with me that it should be. ;-)

Added this with 0/1/0 as expected output to the spectests, and it's passing.

Thanks,

Jonathan

Reply via email to