Nicholas Clark wrote:
Do you have list assignment working properly? ie:

    state (@foo) = @bar;

and, I think,

    state (@foo) = baz();

Aye, thankfully that just fell naturally out of Rakudo's existing list assignment implementation, though it was under-tested. So I just added:

   my @bar = 1,2,3;
   sub swatest {
       state (@foo) = @bar;
       my $x = @foo.perl;
       @foo[0]++;
       return $x
   }
   is swatest(), '[1, 2, 3]', 'array state initialized correctly';
   is swatest(), '[2, 2, 3]', 'array state retained between calls';

And:

   sub swainit_sub { 1,2,3 }
   sub swatest2 {
       state (@foo) = swainit_sub();
       my $x = @foo.perl;
       @foo[0]++;
       return $x
   }
is swatest2(), '[1, 2, 3]', 'array state initialized from call correctly';
   is swatest2(), '[2, 2, 3]', 'array state retained between calls';

Which all pass. Yay.

Thanks!

Jonathan

Reply via email to