diff --git a/doc/Type/List.rakudoc b/doc/Type/List.rakudoc index d8263eb9c..c095982ad 100644 --- a/doc/Type/List.rakudoc +++ b/doc/Type/List.rakudoc @@ -737,6 +737,7 @@ against a L. multi sub pick($count, *@list --> Seq:D) multi method pick(List:D: $count --> Seq:D) + multi method pick(List:D: * --> Seq:D) multi method pick(List:D: --> Mu) If C<$count> is supplied: Returns C<$count> elements chosen at random @@ -754,6 +755,16 @@ Examples: say .pick: 3; # OUTPUT: «(c a e)␤» say .pick: *; # OUTPUT: «(e d a b c)␤» +As of the 2021.06 release of the Rakudo compiler, it is also possible to +specify C<**> (aka C) as the count. + + multi method pick(List:D: ** --> Seq:D) + +In that case, C<.pick> will start picking again on the original list +after it has been exhausted, again and again, indefinitely. + + say .pick(**).head(10); # OUTPUT: «((a c b c a b b c a b))␤» + =head2 routine roll multi sub roll($count, *@list --> Seq:D)