@@ -130,18 +130,18 @@ explicitly put in list-context by surrounding parentheses C<( )>:
130
130
Assignment to a List container (list-context) always triggers list assignment:
131
131
132
132
my @e;
133
- @e = 7,8,9; # list assignment to Array
134
- say @e; # OUTPUT: «[7,8,9]»
133
+ @e = 7,8,9; # list assignment to Array
134
+ say @e; # OUTPUT: «[7,8,9]»
135
135
136
136
my $f;
137
- ($f,) = 7,8,9; # list assignment to List with one element
138
- say $f; # OUTPUT: «7»
139
- say ( ($f,) ).VAR.^name; # OUTPUT: «List»
137
+ ($f,) = 7,8,9; # list assignment to List with one element
138
+ say $f; # OUTPUT: «7»
139
+ say ( ($f,) ).VAR.^name; # OUTPUT: «List»
140
140
141
141
# ATTENTION: special declaration syntax!
142
- my ($g) = 7,8,9; # list assignment to List with one element
143
- say $g; # OUTPUT: «7»
144
- say ( ($g) ).VAR.^name # OUTPUT: «List»
142
+ my ($g) = 7,8,9; # list assignment to List with one element
143
+ say $g; # OUTPUT: «7»
144
+ say ( ($g) ).VAR.^name # OUTPUT: «List»
145
145
146
146
The last two examples above are simple I < destructuring assignments > that select
147
147
the first item of the right-hand side list. See for a more elaborate discussion
0 commit comments