method kxxv

Documentation for method kxxv assembled from the following types:

role Baggy

From Baggy

(Baggy) method kxxv

Defined as:

method kxxv(Baggy:D: --> Seq:D)

Returns a Seq of the keys of the invocant, with each key multiplied by its weight. Note that kxxv only works for Baggy types which have integer weights, i.e. Bag and BagHash.

my $breakfast = bag <spam eggs spam spam bacon>;
say $breakfast.kxxv.sort;                         # OUTPUT: «(bacon eggs spam spam spam)␤» 
 
my $n = ("a" => 0"b" => 1"b" => 2).BagHash;
say $n.kxxv;                                      # OUTPUT: «(b b b)␤»