kxxv
ErrorsCollection

kxxv

Synthesised documentation from type/Baggy type/Mixy

From type/Baggy

See Original text in context

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)␤»

From type/Mixy

See Original text in context

method kxxv()

Throws an exception. The feature is not supported on the type, since there's no clear value to subtract from non-integral weights, to make it work.