File tree Expand file tree Collapse file tree 1 file changed +46
-11
lines changed Expand file tree Collapse file tree 1 file changed +46
-11
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,52 @@ Therefore, there would be a race to do that binding. The C<Scalar> atomic
109
109
operations will never check for or do any such auto-vivification, so as to
110
110
make such bugs much more evident (rather than only observed under stress).
111
111
112
+ = head1 Introspection
113
+
114
+ = head2 method of
115
+
116
+ method of(Scalar:D: --> Mu)
117
+
118
+ Returns the type constraint of the container.
119
+
120
+ Example:
121
+
122
+ my Cool $x = 42;
123
+ say $x.VAR.of; # OUTPUT: «(Cool)»
124
+
125
+ = head2 method default
126
+
127
+ method default(Scalar:D: --> Str)
128
+
129
+ Returns the default value associated with the container.
130
+
131
+ Example:
132
+
133
+ my $x is default(666) = 42;
134
+ say $x.VAR.default; # OUTPUT: «666»
135
+
136
+ = head2 method name
137
+
138
+ method name(Scalar:D: --> Str)
139
+
140
+ Returns the name associated with the container.
141
+
142
+ Example:
143
+
144
+ my $x = 42;
145
+ say $x.VAR.name; # OUTPUT: «$x»
146
+
147
+ = head2 method dynamic
148
+
149
+ method dynamic(Scalar:D: --> Bool)
150
+
151
+ Returns whether the variable is visible in dynamic variable lookups.
152
+
153
+ Example:
154
+
155
+ my $*FOO = 42;
156
+ say $*FOO.VAR.dynamic; # OUTPUT: «True»
157
+
112
158
= head1 Routines
113
159
114
160
= head2 atomic-assign
@@ -207,17 +253,6 @@ manner as follows:
207
253
This will reliably build up a linked list of 4000 items, with 4 nodes with
208
254
each value ranging from 0 up to 999.
209
255
210
- = head2 method of
211
-
212
- method of(Scalar:D: --> Mu)
213
-
214
- Returns the type constraint of the container.
215
-
216
- Example:
217
-
218
- my Cool $x = 42;
219
- say $x.VAR.of.^name; # OUTPUT: «Cool»
220
-
221
256
= head1 Operators
222
257
223
258
= head2 infix ⚛=
You can’t perform that action at this time.
0 commit comments