Skip to content

Commit

Permalink
doc sub forms of combinations, permutations
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Jan 24, 2014
1 parent 18c668f commit 0391fe1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions S32-setting-library/Containers.pod
Expand Up @@ -18,8 +18,8 @@ DRAFT: Synopsis 32: Setting Library - Containers.pod

Created: 19 Feb 2009 extracted from S29-functions.pod

Last Modified: 12 Nov 2013
Version: 45
Last Modified: 24 Jan 2014
Version: 46

If you read the HTML version, it is generated from the Pod in the specs
repository under
Expand Down Expand Up @@ -633,6 +633,7 @@ C<.comb> on that string with the same parameters. See C<Str::comb>.

multi method combinations ( Int $of )
multi method combinations ( Range $of = 0 .. * )
multi combinations ( $n, $k )

Returns all combinations of the list taken N at a time (specified
by the C<$of> parameter). If the range option is taken, then the
Expand All @@ -657,14 +658,19 @@ be the entire list.
It is erroneous to ask for the combinations of any infinite list.
The compiler is allowed to complain if it notices, however.

The functional form assumes it is working on a list of integers C<^$n> taken C<$k> at a time.

=item permutations

multi method permutations ( )
multi permutations ( $n )

Permutes the values of the list, returning the permutations as a
list of (presumably immutable) array values. (Types such as C<Range>
are converted to a list of individual values before permuting them.)

The functional form assumes it is working on a list of integers C<^$n>.

=back

=head2 Array
Expand Down

0 comments on commit 0391fe1

Please sign in to comment.