@@ -149,7 +149,8 @@ You've seen this situation before: it is exactly what happened with the
149
149
signature parameter marked as C < is rw > .
150
150
151
151
X < |\ (container binding) >
152
- Sigilless variables bind by default and so do parameters with the trait C < is raw > .
152
+ Sigilless variables and parameters with the trait C < is raw > always
153
+ bind (whether C < = > or C < := > is used):
153
154
154
155
my $a = 42;
155
156
my \b = $a;
@@ -163,8 +164,8 @@ Sigilless variables bind by default and so do parameters with the trait C<is raw
163
164
= head1 Scalar containers and listy things
164
165
165
166
There are a number of positional container types with slightly different
166
- semantics in Perl 6. The most basic one is L < List|/type/List >
167
- It is created by the comma operator.
167
+ semantics in Perl 6. The most basic one is L < List|/type/List > ;
168
+ it is created by the comma operator.
168
169
169
170
say (1, 2, 3).^name; # OUTPUT: «List»
170
171
@@ -182,7 +183,7 @@ you can still assign to it:
182
183
So the list doesn't care about whether its elements are values or
183
184
containers, they just store and retrieve whatever was given to them.
184
185
185
- Lists can also be lazy, so elements at the end are generated on demand from an
186
+ Lists can also be lazy; in that case, elements at the end are generated on demand from an
186
187
iterator.
187
188
188
189
An C < Array > is just like a list, except that it forces all its elements to
@@ -198,7 +199,7 @@ container with the new one, C<42>.
198
199
199
200
= head1 Assigning and binding to array variables
200
201
201
- Assigning to a scalar variable and to an array variable both do basically
202
+ Assignment to a scalar variable and to an array variable both do
202
203
the same thing: discard the old value(s), and enter some new value(s).
203
204
204
205
Nevertheless, it's easy to observe how different they are:
@@ -227,8 +228,8 @@ As a curious side note, Perl 6 supports binding to array elements:
227
228
If you've read and understood the previous explanations, it is now time to
228
229
wonder how this can possibly work. After all, binding to a variable requires
229
230
a lexpad entry for that variable, and while there is one for an array, there
230
- aren't lexpad entries for each array element ( you cannot expand the lexpad
231
- at run time) .
231
+ aren't lexpad entries for each array element, because you cannot expand the lexpad
232
+ at run time.
232
233
233
234
The answer is that binding to array elements is recognized at the syntax
234
235
level and instead of emitting code for a normal binding operation, a special
0 commit comments