method new-from-pairs
1 | role Baggy |
1.1 | (Baggy) method new-from-pairs |
2 | role Setty |
2.1 | (Setty) method new-from-pairs |
Documentation for method new-from-pairs
assembled from the following types:
role Baggy
From Baggy
(Baggy) method new-from-pairs
Defined as:
method new-from-pairs(* --> 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.