new-from-pairs
ErrorsCollection

new-from-pairs

Synthesised documentation from type/Baggy type/Setty

From type/Baggy

See Original text in context

method new-from-pairs(Baggy: *@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.

From type/Setty

See Original text in context

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.