Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Any.pairup
  • Loading branch information
moritz committed Mar 21, 2015
1 parent 3085663 commit 83b681a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/Type/Any.pod
Expand Up @@ -100,6 +100,19 @@ Interprets the invocant as a list, and returns the last index of that list.
say 6.end; # 0
say <a b c>.end; # 2
=head2 method pairup
method pairup() returns List
Interprets the invocant as a list, and constructs a list of
L<pairs|/type/Pair> from it, in the same way that assignment to a
L<Hash|/type/Hash> does. That is, it takes two consecutive elements and
construs a pair from them, unless the item in the key position already is a
pair (in which case the pair is passed is passed through, and the next
list item, if any, is considered to be a key again).
say (a => 1, 'b', 'c').pairup.perl; # ("a" => 1, "b" => "c").list
=head2 sub exit
sub exit(Int() $status = 0)
Expand Down

0 comments on commit 83b681a

Please sign in to comment.