Skip to content

Commit 4c25994

Browse files
committed
Fixes roll
1 parent fd8d683 commit 4c25994

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

doc/Type/Any.pod6

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -618,12 +618,12 @@ L«C<.list>|/routine/list» method and uses
618618
L«C<List.roll>|/type/List#routine_roll» on it.
619619
620620
my Mix $m = ("þ" xx 3, "ð" xx 4, "ß" xx 5).Mix;
621-
say $m.roll; # OUTPUT: «ð␤»
622-
say $m.roll; # OUTPUT: «(ß ß þ ß þ)␤»
621+
say $m.roll; # OUTPUT: «ð␤»
622+
say $m.roll(5); # OUTPUT: «(ß ß þ ß þ)␤»
623623
624-
C<$m>, in this case, is converted into a list and then a (weighted in
625-
this case) dice is rolled on it. See also
626-
L<C<List.roll>|/type/List#routine_roll> for more information.
624+
C<$m>, in this case, is converted into a list and then a (weighted in this case)
625+
dice is rolled on it. See also L<C<List.roll>|/type/List#routine_roll> for more
626+
information.
627627
628628
=head2 method pick
629629

doc/Type/List.pod6

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -669,10 +669,11 @@ Defined as:
669669
multi method roll(List:D: $count --> Seq:D)
670670
multi method roll(List:D: --> Mu)
671671
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.
676677
677678
If C<$count> is omitted: Returns a single random item from the list, or
678679
Nil if the list is empty
@@ -971,10 +972,11 @@ Practical example:
971972
!! "($number $op $formula)"
972973
}
973974
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:
978980
979981
sub infix:<foo>($a, $b) is assoc<right> { "($a, $b)" }
980982
say [foo] 1, 2, 3, 4; # OUTPUT: «(1, (2, (3, 4)))␤»

0 commit comments

Comments
 (0)