See Original text in context
method kxxv(Baggy: --> Seq)
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 = bag <spam eggs spam spam bacon>;say .kxxv.sort; # OUTPUT: «(bacon eggs spam spam spam)»my = ("a" => 0, "b" => 1, "b" => 2).BagHash;say .kxxv; # OUTPUT: «(b b b)»
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.