Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dogbert17/226e7adbd1be17f38f00986b2e8e1bc0 to your computer and use it in GitHub Desktop.
Save dogbert17/226e7adbd1be17f38f00986b2e8e1bc0 to your computer and use it in GitHub Desktop.
Attempt to document Capture.pairs
=head2 method pairs
Defined as:
multi method pairs(Capture:D:) returns Seq:D
Usage:
$capture.pairs
Returns all arguments, the positional followed by the named, as a
L<Seq|/type/Seq> of L<pairs|/type/Pair>. Positional arguments have
their respective ordinal value, starting at zero, as key while the
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment