Documentation for method new-from-pairs
assembled from the following pages:
Role: Baggy §
From Baggy
(Baggy) method new-from-pairs §
Defined as:
method new-from-pairs(Baggy: * --> Baggy)
Constructs a Baggy objects from a list of Pair
objects given as positional arguments:
say Mix.new-from-pairs: 'butter' => 0.22, 'sugar' => 0.1, 'sugar' => 0.02;# OUTPUT: «Mix(butter(0.22) sugar(0.12))»
Note: be sure you aren't accidentally passing the Pairs as positional arguments; the quotes around the keys in the above example are significant.
Role: Setty §
From Setty
(Setty) method new-from-pairs §
Defined as:
method new-from-pairs(* --> Setty)
Constructs a Setty object from a list of Pair
objects given as positional arguments:
say Set.new-from-pairs: 'butter' => 0.22, 'salt' => 0, 'sugar' => 0.02;# OUTPUT: «Set(butter sugar)»
Note: be sure you aren't accidentally passing the Pairs as positional arguments; the quotes around the keys in the above example are significant.