Skip to content

Commit 44a72d7

Browse files
committed
Adds another example showing flattening slurpiness
As suggested by @CIAvash. Refs #2344
1 parent a3be583 commit 44a72d7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/Type/List.pod6

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ But it behaves slurpily, inserting all arguments (after the first, which is the
216216
separator) into a single array
217217
218218
say join('|', 3, 'þ', 1+4i); # OUTPUT: «3|þ|1+4i␤»
219+
say join ', ', <a b c>, 'd', 'e' , 'f'; OUTPUT: «a, b, c, d, e, f␤»
220+
221+
In this case, the first list C«<a b c» is I<slurped> and flattened, unlike what
222+
happens when C<join> is invoked as a method.
219223
220224
=head2 routine map
221225

0 commit comments

Comments
 (0)