You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/Language/operators.pod6
+5-8Lines changed: 5 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2195,28 +2195,25 @@ X<|...,operators>X<|...^,operators>X<|…,operators>X<|…^,operators>X<|lazy li
2195
2195
multi sub infix:<...>(**@) is assoc<list>
2196
2196
multi sub infix:<...^>(**@) is assoc<list>
2197
2197
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.
2199
2199
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>.
2201
2201
2202
2202
The sequence operator invokes the generator with as many arguments as
2203
2203
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:
2208
2205
2209
2206
say 1 ... 4; # OUTPUT: «(1 2 3 4)»
2210
2207
say 4 ... 1; # OUTPUT: «(4 3 2 1)»
2211
2208
say 'a' ... 'e'; # OUTPUT: «(a b c d e)»
2212
2209
say 'e' ... 'a'; # OUTPUT: «(e d c b a)»
2213
2210
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,
2215
2212
with a default generator of *.succ
2216
2213
2217
2214
say (1 ... *)[^5]; # OUTPUT: «(1 2 3 4 5)»
2218
2215
2219
-
Custom generators have to be the last argument before the '...' operator.
2216
+
Custom generators need to be the last argument before the '...' operator.
2220
2217
This one takes two arguments, and generates the Fibonacci numbers
0 commit comments