@@ -65,18 +65,19 @@ values become the associated integer weights:
65
65
say $n.keys.map(&WHAT); # OUTPUT: «((Str) (Str))»
66
66
say $n.values.perl; # OUTPUT: «(1, 4).Seq»
67
67
68
- Furthermore, you can get a C < Bag > by using bag operators (see next section) on
69
- objects of other types such as L < List > , which will internally call C < .Bag >
70
- on them before performing the operation. Be aware of the tight precedence of
71
- those operators though, which may require you to use parentheses around arguments:
68
+ Furthermore, you can get a C < Bag > by using bag operators (see next
69
+ section) on objects of other types such as L < List > , which will
70
+ internally call C < .Bag > on them before performing the operation. Be
71
+ aware of the tight precedence of those operators though, which may
72
+ require you to use parentheses around arguments:
72
73
73
74
say (1..5) (+) 4; # OUTPUT: «bag(1, 2, 3, 4(2), 5)»
74
75
75
76
= head1 Operators
76
77
77
- Perl 6 provides common set and bag operators, which can take C < Bag > s (or any
78
- other collections) as input, and return result as C < Bool > , C < Set > or C < Bag >
79
- values. For example:
78
+ Perl 6 provides common set and bag operators, which can take C < Bag > s (or
79
+ any other collections) as input, and return result as C < Bool > , C < Set > or
80
+ C < Bag > values. For example:
80
81
81
82
= begin code
82
83
my ($a, $b) = bag(2, 2, 4), bag(2, 3, 3, 4);
0 commit comments