Skip to content

Commit 27b3eb7

Browse files
committed
Adds indexing for contexts
1 parent 9acacc8 commit 27b3eb7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/Language/contexts.pod6

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
A context is needed, in many occasions, to interpret the value of a container. In Perl 6, we will use context to coerce the value of a container into some type or class, or decide what to do with it, as in the case of the sink context.
88
9-
=head1 Sink
9+
=head1 Sink X<|sink context>
1010
1111
I<Sink> is equivalent to C<void> context, that is, a context in which we throw (down the sink, as it were) the result of an operation or the return value from a block. In general, this context will be invoked in warnings and errors when a statement does not know what to do with that value.
1212
@@ -19,7 +19,7 @@ You can force that sink context on L<Iterator>s, by using the L<C<sink-all>|/rou
1919
2020
In general, blocks will warn if evaluated in sink context; however, L<gather/take blocks|/language/control#Flow%29_gather_take> are explicitly evaluated in sink context, with values returned explicitly using C<take>.
2121
22-
=head1 Number
22+
=head1 Number X<|number context>
2323
2424
This context, and probably all of them except sink above, are I<conversion> or I<interpretation> contexts in the sense that they take an untyped or typed variable and duck-type it to whatever is needed to perform the operation. In some cases that will imply a conversion (from L<Str> to L<Int>, for instance); in other cases simply an interpretation (L<IntStr> will be interpreted as L<Int> or as L<Str>).
2525
@@ -47,7 +47,7 @@ say True+$list; # OUTPUT: «4␤»
4747
4848
In the case of I<listy> things, the numeric value will be in general equivalent to C<.elems>; in some cases, like L<Thread|/Numeric#(Thread)_method_Numeric> it will return an unique thread identifier.
4949
50-
=head1 String
50+
=head1 String X<|string context>
5151
5252
In a I<string context>, values can be manipulated as strings. This context is used, for instance, for printing values to standard output.
5353

0 commit comments

Comments
 (0)