File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,24 @@ typically L<Mu>.
49
49
method Setty(--> Setty:D)
50
50
51
51
Coerce the C < QuantHash > object to the equivalent object that uses the L < Setty >
52
- role.
52
+ role. Note that for L < Mixy > type coercion items with negative values will be skipped.
53
+
54
+ my %b is Bag = one => 1, two => 2;
55
+ say %b.Setty; # OUTPUT: «set(one two)»
56
+ my %m is Mix = one => 1, minus => -1;
57
+ say %m.Setty; # OUTPUT: «set(one)»
53
58
54
59
= head2 method Baggy
55
60
56
61
method Baggy(--> Baggy:D)
57
62
58
63
Coerce the C < QuantHash > object to the equivalent object that uses the L < Baggy >
59
- role.
64
+ role. Note that for L < Mixy > type coercion items with negative values will be skipped.
65
+
66
+ my %s is Set = <one two>;
67
+ say %s.Baggy; # OUTPUT: «Bag(one, two)»
68
+ my %m is Mix = one => 1, minus => -1;
69
+ say %m.Baggy; # OUTPUT: «Bag(one)»
60
70
61
71
= head2 method Mixy
62
72
65
75
Coerce the C < QuantHash > object to the equivalent object that uses the L < Mixy >
66
76
role.
67
77
78
+ my %s is Set = <one two>;
79
+ say %s.Mixy; # OUTPUT: «Mix(one, two)»
80
+ my %b is Bag = one => 1, two => 2;
81
+ say %b.Mixy; # OUTPUT: «Mix(one, two)»
82
+
68
83
= end pod
69
84
70
85
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
You can’t perform that action at this time.
0 commit comments