Skip to content

Commit 33e27ba

Browse files
authored
Generator to ... is not an argument, but a value in the list
It doesn't even have to be a literal. > my $lhs = (5, { $_ * 2 }); > say $lhs ... 40; (5 10 20 40)
1 parent 96ec084 commit 33e27ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/Language/operators.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ with a default generator of *.succ
22752275
22762276
say (1 ... *)[^5]; # OUTPUT: «(1 2 3 4 5)␤»
22772277
2278-
Custom generators need to be the last argument before the '...' operator.
2278+
Custom generators need to be the last element of the list before the '...' operator.
22792279
This one takes two arguments, and generates the Fibonacci numbers
22802280
22812281
say (1, 1, -> $a, $b { $a + $b } ... *)[^8]; # OUTPUT: «(1 1 2 3 5 8 13 21)␤»

0 commit comments

Comments
 (0)