Skip to content

Commit 07bafa3

Browse files
authored
Adds next/last refs #2632
Added the fact that since version 6.d, the `next` or `last` command in a loop that collects its last statement values returns `Empty` for the iterations they run on.
1 parent 608b3e7 commit 07bafa3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/Language/control.pod6

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,9 @@ while ($i < 10) {
10381038
# OUTPUT: «1 is odd.␤3 is odd.␤5 is odd.␤7 is odd.␤9 is odd.␤»
10391039
=end code
10401040
1041+
*Since version 6.d, the C<next> command in a loop that collects its last statement values
1042+
returns C<Empty> for the iterations they run on.*
1043+
10411044
=head1 X<last|control flow, last>
10421045
10431046
The C<last> command immediately exits the loop in question.
@@ -1073,6 +1076,9 @@ while ($i < 10) {
10731076
# OUTPUT: «The last number was 5.␤»
10741077
=end code
10751078
1079+
*Since version 6.d, the C<last> command in a loop that collects its last statement values
1080+
returns C<Empty> for the iterations they run on.*
1081+
10761082
=head1 X<redo|control flow, redo>
10771083
10781084
The C<redo> command restarts the loop block without evaluating the

0 commit comments

Comments
 (0)