@@ -577,7 +577,7 @@ C<.comb> on that string with the same parameters. See C<Str::comb>.
577
577
=item combinations
578
578
579
579
multi method combinations ( Int $of )
580
- multi method combinations ( Range $of = 1 .. * )
580
+ multi method combinations ( Range $of = 0 .. * )
581
581
582
582
Returns all combinations of the list taken N at a time (specified
583
583
by the C<$of> parameter). If the range option is taken, returns all
@@ -591,6 +591,10 @@ container, so that subsets of sets can actually be a set of sets.
591
591
If the ordering of the input doesn't matter, neither does the ordering
592
592
of the subsets.)
593
593
594
+ Note that, without an argument, the first returned combination will
595
+ always be the empty list, and the last combination will always
596
+ be the entire list.
597
+
594
598
It is erroneous to ask for the combinations of any infinite list.
595
599
The compiler is allowed to complain if it notices, however.
596
600
@@ -1119,14 +1123,13 @@ Works like an ordinary list C<roll>.
1119
1123
=item combinations
1120
1124
1121
1125
multi method combinations ( Int $of )
1122
- multi method combinations ( Range $of = 1 .. * )
1126
+ multi method combinations ( Range $of = 0 .. * )
1123
1127
1124
1128
Works as if the set were turned into a list of elements and then
1125
1129
the combinations were turned back into a list of sets, ordered by
1126
1130
increasing size. You may, of course, turn that list back into a set of sets.
1127
1131
1128
- Note that, without an argument, this method does not quite calculate
1129
- the powerset; you must explictly call with a range of 0..* for that.
1132
+ Note that, without an argument, this method basically calculates the powerset.
1130
1133
1131
1134
=back
1132
1135
0 commit comments