Skip to content

Commit

Permalink
Adds Empty in the context of loops
Browse files Browse the repository at this point in the history
Refs #2721, partially fulfilling it.
  • Loading branch information
JJ committed Apr 25, 2019
1 parent 0ae8001 commit 4634e33
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/Language/control.pod6
Expand Up @@ -516,6 +516,14 @@ assign them to an array:
my @a = do for 1, 2, 3 { $_ * 2 }; @a.say; # OUTPUT «[2 4 6]␤»
my @b = (for 1, 2, 3 { $_ * 2 }); @b.say; # OUTPUT: «[2 4 6]␤»
The C<Empty> constant will act as a no-op for a loop:
=for code
say "Not here" for Empty;
Will not do anything. This constant is
L<equivalent to a empty Slip or List|/syntax/Empty>.
=head1 X<gather/take|control flow,gather take>
X<|lazy list,gather>X<|lazy list,take>
Expand Down

0 comments on commit 4634e33

Please sign in to comment.