Created
June 20, 2016 19:52
-
-
Save dogbert17/8f9272fe0ac15d82e6cc065372603b9b to your computer and use it in GitHub Desktop.
Attempt to document Baggy.antipairs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =head2 method antipairs | |
| Defined as: | |
| method antipairs(Baggy:D:) returns Seq:D | |
| Returns all elements and their respective weights as a L<Seq|/type/Seq> of C<Pair>s | |
| where the element itself is the value and the weight of that element is the key, i.e. | |
| the opposite of method L<pairs|#method pairs>. | |
| my $breakfast = bag <eggs bacon>; | |
| my $seq = $breakfast.antipairs; | |
| say $seq.sort; # (1 => eggs 2 => bacon) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment