Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added docs for Capture.antipairs
  • Loading branch information
Jan-Olof Hendig committed Jul 8, 2016
1 parent d1ed93b commit 44a60a7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/Type/Capture.pod6
Expand Up @@ -174,6 +174,25 @@ named arguments have their names as key.
my Capture $c = \(2, 3, apples => (red => 2));
say $c.pairs; # (0 => 2 1 => 3 apples => red => 2)
=head2 method antipairs
Defined as:
multi method antipairs(Capture:D:) returns Seq:D
Usage:
$capture.antipairs
Returns all arguments, the positional followed by the named, as a
L<Seq|/type/Seq> of L<pairs|/type/Pair> where the keys and values
have been swapped, i.e. the value becomes the key and the key becomes
the value. This behavior is the opposite of the L<pairs|#method_pairs>
method.
my $capture = \(2, 3, apples => (red => 2));
say $capture.antipairs; # (2 => 0 3 => 1 (red => 2) => apples)
=head2 method Bool
Defined as:
Expand Down

0 comments on commit 44a60a7

Please sign in to comment.