diff --git a/doc/Type/List.pod6 b/doc/Type/List.pod6 index ed9c1e48c..e4956ec77 100644 --- a/doc/Type/List.pod6 +++ b/doc/Type/List.pod6 @@ -278,28 +278,26 @@ Defined as: Treats the elements of the list as strings by calling L|/type/Any#routine_Str> on each of them, interleaves them with -C<$separator> and concatenates everything into a single string. Note that you -can omit the C<$separator> if you use the method syntax. +C<$separator> and concatenates everything into a single string. Example: join ', ', ; # OUTPUT: «a, b, c» -Note that the method form does not flatten sublists: - - say (1, ).join('|'); # OUTPUT: «1|a b c␤» - The method form also allows you to omit the separator: say .join; # OUTPUT: «abc␤» -But it behaves slurpily, flattening all arguments after the first into a single -list: +Note that the method form does not flatten sublists: + + say (1, ).join('|'); # OUTPUT: «1|a b c␤» + +The subroutine form behaves slurpily, flattening all arguments after +the first into a single list: - say join('|', 3, 'þ', 1+4i); # OUTPUT: «3|þ|1+4i␤» - say join ', ', , 'd', 'e' , 'f'; # OUTPUT: «a, b, c, d, e, f␤» + say join '|', 1, ; # OUTPUT: «1|a|b|c␤» -In this case, the first list C« and flattened, unlike what +In this case, the list C«» is I and flattened, unlike what happens when C is invoked as a method. If one of the elements of the list happens to be a C, then C