Skip to content

Commit 17681ed

Browse files
committed
Remove a PAE for a WAT that the GLR eliminated
1 parent 4076e53 commit 17681ed

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

doc/Language/traps.pod

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -157,35 +157,6 @@ Instead, use an expression that produces a value when you want a value.
157157
158158
=head1 Arrays
159159
160-
=head2 Number of elements in an array when assigning the empty array
161-
162-
Assigning an empty array to an array saves the empty array as an item in the
163-
array. This is why the number of elements will turn out to be 1 instead of
164-
zero as might be expected by the unwary.
165-
166-
my @array = []; # assigns empty array as an item in @array
167-
say @array.elems; #-> 1
168-
169-
Whereas querying the number of elements of the empty array directly returns
170-
zero as expected:
171-
172-
say [].elems; #-> 0
173-
174-
This can be more clearly seen by calling the C<.perl> method on the object:
175-
176-
my @array = [];
177-
say @array.perl; #-> Array.new([]) # an array containing an empty array
178-
179-
in contrast to:
180-
181-
my @array = ();
182-
say @array.perl; #-> Array.new() # a truly empty array
183-
184-
Note that this is I<also> the behaviour in Perl 5:
185-
186-
perl -E "say scalar(my @array = [])" #-> 1
187-
perl -E "say scalar(my @array = ())" #-> 0
188-
189160
=head2 Referencing the last element of an array
190161
191162
In Perl 5 one could reference the last element of an array by asking for the

0 commit comments

Comments
 (0)