@@ -669,10 +669,11 @@ Defined as:
669
669
multi method roll(List:D: $count --> Seq:D)
670
670
multi method roll(List:D: --> Mu)
671
671
672
- If C < $count > is supplied: Returns a sequence of C < $count > elements, each randomly
673
- selected from the list. Each random choice is made independently, like a separate
674
- die roll where each die face is a list element. If C < * > is passed as C < $count >
675
- returns a lazy, infinite sequence of randomly chosen elements from the original list.
672
+ If C < $count > is supplied: Returns a sequence of C < $count > elements, each
673
+ randomly selected from the list. Each random choice is made independently, like
674
+ a separate die roll where each die face is a list element. If C < * > is passed as
675
+ C < $count > returns a lazy, infinite sequence of randomly chosen elements from the
676
+ original list.
676
677
677
678
If C < $count > is omitted: Returns a single random item from the list, or
678
679
Nil if the list is empty
@@ -971,10 +972,11 @@ Practical example:
971
972
!! "($number $op $formula)"
972
973
}
973
974
974
- I < Note: > In the functional programming world, this operation is generally
975
- called a L < fold|https://en.wikipedia.org/wiki/Fold_%28higher-order_function%29#Folds_on_lists > .
976
- With a right-associative operator it is a right fold, otherwise (and usually)
977
- it is a left fold:
975
+ I < Note: > In the functional programming world, this operation is generally called
976
+ a
977
+ L < fold|https://en.wikipedia.org/wiki/Fold_%28higher-order_function%29#Folds_on_lists > .
978
+ With a right-associative operator it is a right fold, otherwise (and usually) it
979
+ is a left fold:
978
980
979
981
sub infix:<foo>($a, $b) is assoc<right> { "($a, $b)" }
980
982
say [foo] 1, 2, 3, 4; # OUTPUT: «(1, (2, (3, 4)))»
0 commit comments