Skip to content

Commit b876c85

Browse files
committed
Adds indexing for sinking
Which had already been documented in #732. Closes #1309.
1 parent 6027c8a commit b876c85

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

doc/Language/contexts.pod6

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ my $sub = -> $a { return $a² };
1515
$sub; # OUTPUT: «WARNINGS:␤Useless use of $sub in sink context (line 1)␤»
1616
=end code
1717
18+
X<|sinking>
1819
You can force that sink context on L<Iterator>s, by using the L<C<sink-all>|/routine/sink-all> method. L<Proc>s can also be L<sunk via the C<sink> method|https://docs.perl6.org/type/Proc#method_sink>, forcing them to raise an exception and not returning anything.
1920
2021
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>.

0 commit comments

Comments
 (0)