Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[List] pairs, splice
  • Loading branch information
moritz committed Jun 10, 2012
1 parent 47dbe4a commit 7578a27
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/List.pod
Expand Up @@ -80,6 +80,15 @@ Returns
0, 'a', 1, 'b', 2, 'c'
=head3 pairs
multi sub pairs($list) returns List:D
multi method pairs(List:D:) returns List:D
Returns a list of pairs, with the indexes as keys and the list values as
values.
<a b c>.pairs # 0 => 'a', 1 => 'b', 2 => 'c'
=head3 join
Expand Down Expand Up @@ -229,5 +238,13 @@ generated that way.
Note that C<reduce> is an implicit loop, and thus responds to C<next>, C<last>
and C<redo> statements.
=head3 splice
multi sub splice(@list, $start, $elems? *@replacement) returns List:D
multi method splice(List:D: $start, $elems? *@replacement) returns List:D
Deletes C<$elems> elements starting from index C<$start> from the list,
returns them and replaces them by C<@replacement>. If C<$elems> is omitted,
all the elements starting from index C<$start> are deleted.
=end pod

0 comments on commit 7578a27

Please sign in to comment.