Skip to content

Commit e2130a2

Browse files
committed
Adds better example for Any.roll
Eliminates the class example, and adds pointers. Refs #1731
1 parent fadb13b commit e2130a2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/Type/Any.pod6

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,12 @@ Coerces the invocant to a C<list> by applying its
605605
L«C<.list>|/routine/list» method and uses
606606
L«C<List.roll>|/type/List#routine_roll» on it.
607607
608-
say Any.roll; # OUTPUT: «(Any)␤»
609-
say Any.roll(5); # OUTPUT: «((Any) (Any) (Any) (Any) (Any))␤»
608+
my Mix $m = ("þ" xx 3, "ð" xx 4, "ß" xx 5).Mix
609+
say $m.roll; # OUTPUT: «ð␤»
610+
say $m.roll; # OUTPUT: «(ß ß þ ß þ)␤»
611+
612+
C<$m>, in this case, is converted into a list and then a (weighted in
613+
this case) dice is rolled on it. See also L<C<List.roll>|/type/List#routine_roll> for more information.
610614
611615
=head2 method pick
612616

0 commit comments

Comments
 (0)