Skip to content

Commit 9827475

Browse files
committed
Adds indexing for Zen slices; minor revs closes #2044
1 parent 3f4a403 commit 9827475

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/Language/subscripts.pod6

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,16 @@ This behavior exists as a precaution to prevent runaway generation of massive,
304304
potentially infinite C<Lists> and the out-of-memory issues that occur as a
305305
result.
306306
307+
X<|Zen slices>
307308
=head2 Zen slices
308309
309-
If you write a subscript without specifying any indices/keys at all, it simply
310+
If you put the subscript operator behind an object without specifying any indices/keys at all, it simply
310311
returns the subscripted object itself. Since it is empty but returns
311-
everything, it is known as a "Zen slice".
312+
everything, it is known as a I<Zen slice>.
312313
313-
It is different both from passing a Whatever-star (which, like a normal slice,
314+
Zen slicing is different from passing a Whatever-star (which, like a normal slice,
314315
always returns a List of elements no matter the type of the original object)
315-
and from passing an empty list (which returns an empty slice):
316+
or an empty list (which returns an empty slice):
316317
317318
my %bag := (orange => 1, apple => 3).Bag;
318319
say %bag<>; # OUTPUT: «Bag(apple(3), orange)␤»

0 commit comments

Comments
 (0)