diff --git a/lib/Type/List.pod b/lib/Type/List.pod index 41d4ac3c0..8f688f537 100644 --- a/lib/Type/List.pod +++ b/lib/Type/List.pod @@ -516,14 +516,31 @@ by the signature: say "Name: $name; Zip code: $zip"; } -By default the C function reads to the end of the shortest list, -but a short list may always be extended arbitrarily by putting C<*> -after the final value, which replicates the final value as many times -as necessary. If instead of supplying a default value for short lists, -you just wish to skip missing entries, use C instead: +By default the C function reads to the end of the shortest list, but a +short list may always be extended arbitrarily by putting C<*> after the +final value, which replicates the final value as many times as necessary. +If instead of supplying a default value for short lists, you just wish to +skip missing entries, use L instead: for roundrobin(@queue1; @queue2; @queue3) -> $next { ... } +=head2 sub roundrobin + + multi roundrobin(List:D: --> Parcel) + +C is very similar to L. The +difference is that C will not stop on lists that run out of +elements but simply skip any undefined value: + + my @a = 1; + my @b = 1..2; + my @c = 1..3; + for roundrobin(@a; @b; @c) -> $x { $x.say } + +will display the following values: C<1, 1, 1, 2, 2, 3> + =end pod + +# vim: expandtab shiftwidth=4 ft=perl6