Created
June 7, 2016 21:43
-
-
Save dogbert17/1762f03949c76c8bb0d171725acfc73d to your computer and use it in GitHub Desktop.
Attempt to document Baggy.kxxv
This file contains 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 kxxv | |
Defined as: | |
method kxxv(Baggy:D:) returns List:D | |
Returns a list of the keys of the invocant, with each key multiplied by its | |
weight. Note that C<kxxv> only works for C<Baggy> types which have integer | |
weights, i.e. L<Bag> and L<BagHash>. | |
my $breakfast = bag <spam eggs spam spam bacon>; | |
say $breakfast.kxxv.sort; # (bacon eggs spam spam spam) | |
my $n = ("a" => 0, "b" => 1, "b" => 2).BagHash; | |
say $n.kxxv; # (b b b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment