Skip to content

Commit a993e37

Browse files
committed
Adds string contextualizer ~ refs #1225
1 parent ce6422a commit a993e37

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/Language/contexts.pod6

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ Or when smart-matching to a regular expression:
5959
6060
In general, the L<C<Str> routine|/routine/Str> will be called on a variable to contextualize it; since this method is inherited from L<Mu>, it is always present, but it is not always guaranteed to work. In some core classes it will issue a warning.
6161
62+
L<C<~>|/routine/~> is the (unary) string contextualizer. As an operator, it concatenates strings, but as a prefix operator it becomes the string context operator.
63+
64+
=begin code
65+
my @array = [ [1,2,3], [4,5,6]];
66+
say ~@array; # OUTPUT: «1 2 3 4 5 6␤»
67+
=end code
68+
6269
=end pod
6370

6471
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)