Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
List.rotor: redesign second argument from overlap to gap
explicit allow negative gaps to mean overlap
  • Loading branch information
moritz committed Apr 23, 2015
1 parent 7068bfb commit ea466e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions S32-setting-library/Containers.pod
Expand Up @@ -683,14 +683,16 @@ The functional form assumes it is working on a list of integers C<^$n>.

=item rotor

multi method rotor ( $elems = 2, $overlap = 1 )
multi method rotor ( Int() $elems, Int() $gap = 0 )

Returns a new list of sublists formed by returning a sublist of C<$elems>
elements, backing up by C<$overlap> elements, then repeating. Stops as
elements, advancing/skipping C<$gap> elements, then repeating. Stops as
soon as there are no longer enough remaining elements to form a sublist
that is C<$elems> long. (From which it follows that an infinite list
can be rotorized forever.)

Negative gaps are allowed, meaning the result lists will contain overlap.

=item pairup

multi method pairup ( )
Expand Down

0 comments on commit ea466e4

Please sign in to comment.