File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -74,10 +74,10 @@ possible to change the value from outside of the C<Pair> itself:
74
74
= begin code
75
75
my $v = 'value A';
76
76
my $pair = a => $v;
77
- $pair.say; # OUTPUT: a => value A
77
+ $pair.say; # OUTPUT: « a => value A»
78
78
79
79
$v = 'value B';
80
- $pair.say; # OUTPUT: a => value B
80
+ $pair.say; # OUTPUT: « a => value B»
81
81
= end code
82
82
83
83
Please also note that this behavior is totally unrelated to the way used to
@@ -93,9 +93,16 @@ my $v = 'value B';
93
93
my $pair = a => $v;
94
94
$pair.freeze;
95
95
$v = 'value C';
96
- $pair.say; # OUTPUT: a => value B
96
+ $pair.say; # OUTPUT: « a => value B»
97
97
= end code
98
98
99
+ As Pair implements L < Associative|/type/Associative > role, its value can be
100
+ accessed using Associative subscription operation. Subscrip adverbs work as well.
101
+
102
+ = for code
103
+ my $pair = a => 5;
104
+ say $pair<a>; # OUTPUT: «5»
105
+ say $pair<a>:exists; # OUTPUT: «True»
99
106
100
107
= head1 Methods
101
108
You can’t perform that action at this time.
0 commit comments