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(*@pairs --> Baggy:D)

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(*@pairs --> Setty:D)

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.