On Thu, Feb 21, 2013 at 09:07:44AM -0800, Ricardo SIGNES wrote:
> This program never terminates:
> 
>   use v6;
> 
>   my @a = << >>;
>   while (my @c = splice @a, 0, 3) {
>     say "one more";
>   }

After each splice, @c ends up being @(Any, Any, Any).  I'm not
sure if this is correct; I can see that it should probably
return whatever is actually in the array and not pad.

The following should work:

    my @a = ();

    while ( @a ) {
       my @c = splice @a, 0, 3;
       say "one more";
    }

Hope this helps,

Pm

Reply via email to