@@ -261,10 +261,9 @@ dimensions>) the subscript is preserved across the slice operation
261
261
262
262
= head2 Truncating slices
263
263
264
- Referring to nonexistent elements in a slice subscript causes the
265
- output C < List > to contain undefined values (or L < whatever else|
266
- #Nonexistent elements > the collection in question chooses to return for
267
- nonexistent elements):
264
+ Referring to nonexistent elements in a slice subscript causes the output C < List >
265
+ to contain undefined values (or L < whatever else| #Nonexistent elements > the
266
+ collection in question chooses to return for nonexistent elements):
268
267
269
268
= begin code
270
269
my @letters = <a b c d e f>;
@@ -307,13 +306,13 @@ result.
307
306
X < |Zen slices >
308
307
= head2 Zen slices
309
308
310
- If you put the subscript operator behind an object without specifying any indices/keys at all, it simply
311
- returns the subscripted object itself. Since it is empty but returns
312
- everything, it is known as a I < Zen slice > .
309
+ If you put the subscript operator behind an object without specifying any
310
+ indices/keys at all, it simply returns the subscripted object itself. Since it
311
+ is empty but returns everything, it is known as a I < Zen slice > .
313
312
314
- Zen slicing is different from passing a Whatever-star (which, like a normal slice,
315
- always returns a List of elements no matter the type of the original object)
316
- or an empty list (which returns an empty slice):
313
+ Zen slicing is different from passing a Whatever-star (which, like a normal
314
+ slice, always returns a List of elements no matter the type of the original
315
+ object) or an empty list (which returns an empty slice):
317
316
318
317
my %bag := (orange => 1, apple => 3).Bag;
319
318
say %bag<>; # OUTPUT: «Bag(apple(3), orange)»
@@ -339,7 +338,7 @@ elements and dimensions.
339
338
say @twodim[0,1;1]; # 2nd element of both lists
340
339
# OUTPUT: «(b 2)»
341
340
342
- X < |; ( flattening) >
341
+ X < |flattening ; >
343
342
344
343
Multidimensional subscripts can be used to flatten nested lists when combined
345
344
with L < Whatever > .
0 commit comments