Skip to content

Commit 7b46298

Browse files
committed
Another attempt at describing …. Refs #1103
1 parent 894292a commit 7b46298

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

doc/Language/operators.pod6

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,28 +2195,25 @@ X<|...,operators>X<|...^,operators>X<|…,operators>X<|…^,operators>X<|lazy li
21952195
multi sub infix:<...>(**@) is assoc<list>
21962196
multi sub infix:<...^>(**@) is assoc<list>
21972197
2198-
The X<sequence operator> is a generic operator to produce generic lists and sequences, including lazy lists if the sequence endpoint is C<Inf>.
2198+
The X<sequence operator> will produce generic sequences on demand.
21992199
2200-
The left hand side will include initial elements; it may include a generator too. The right hand side will have an endpoint, which can be C<Inf> or C<*> for lazy infinite lists, an expression which will end the sequence when C<True>, or other elements such as L<Junctions>.
2200+
The left hand side will always include initial elements; it may include a generator too. The right hand side will have an endpoint, which can be C<Inf> or C<*> for "infinite" lists (whose elements are only produced on demand), an expression which will end the sequence when C<True>, or other elements such as L<Junctions>.
22012201
22022202
The sequence operator invokes the generator with as many arguments as
22032203
necessary. The arguments are taken from the initial elements and the already
2204-
generated elements.
2205-
2206-
The default generator is C<*.>L<succ> or C<*.>L<pred>, depending on how
2207-
the end points compare:
2204+
generated elements. The default generator is C<*.>L<succ> or C<*.>L<pred>, depending on how the end points compare:
22082205
22092206
say 1 ... 4; # OUTPUT: «(1 2 3 4)␤»
22102207
say 4 ... 1; # OUTPUT: «(4 3 2 1)␤»
22112208
say 'a' ... 'e'; # OUTPUT: «(a b c d e)␤»
22122209
say 'e' ... 'a'; # OUTPUT: «(e d c b a)␤»
22132210
2214-
An endpoint of C<*>, C<Inf> or C<> (L<Whatever>) lazily generates an infinite sequence,
2211+
An endpoint of C<*> (L<Whatever>), C<Inf> or C<> generates on demand an infinite sequence,
22152212
with a default generator of *.succ
22162213
22172214
say (1 ... *)[^5]; # OUTPUT: «(1 2 3 4 5)␤»
22182215
2219-
Custom generators have to be the last argument before the '...' operator.
2216+
Custom generators need to be the last argument before the '...' operator.
22202217
This one takes two arguments, and generates the Fibonacci numbers
22212218
22222219
say (1, 1, -> $a, $b { $a + $b } ... *)[^8]; # OUTPUT: «(1 1 2 3 5 8 13 21)␤»

0 commit comments

Comments
 (0)