@@ -97,7 +97,7 @@ argument. Creates an empty C<Seq> if called with no argument.
97
97
98
98
= head2 method iterator
99
99
100
- method iterator(Seq:D: --> Iterator:D )
100
+ method iterator(Seq:D:)
101
101
102
102
If the C < Seq > is not cached, returns the underlying iterator and marks
103
103
the invocant as consumed. If called on an already consumed sequence,
@@ -107,12 +107,21 @@ Otherwise returns an iterator over the cached list.
107
107
108
108
= head2 method is-lazy
109
109
110
- method is-lazy(Seq:D: --> Bool:D )
110
+ method is-lazy(Seq:D:)
111
111
112
112
Returns C < True > if and only if the underlying iterator or cached list
113
113
considers itself lazy. If called on an already consumed sequence, throws
114
114
an error of type L < X::Seq::Consumed|/type/X::Seq::Consumed > .
115
115
116
+ = head2 method Seq
117
+
118
+ Defined as
119
+
120
+ multi method Seq(Seq:D:)
121
+
122
+ Clones the object.
123
+
124
+
116
125
= head2 method Capture
117
126
118
127
Defined as
@@ -134,24 +143,25 @@ L<fails|/routine/fail> with L<X::Cannot::Lazy|/type/X::Cannot::Lazy>.
134
143
135
144
= head2 method from-loop
136
145
137
- multi method from-loop(&body --> Seq:D)
138
- multi method from-loop(&body, &cond, :$repeat --> Seq:D)
139
- multi method from-loop(&body, &cond, &afterward --> Seq:D)
146
+ multi method from-loop(&body, :$label)
147
+ multi method from-loop(&body, &cond, :$repeat!, :$label)
148
+ multi method from-loop(&body, &cond, :$label)
149
+ multi method from-loop(&body, &cond, &afterwards, :$label)
140
150
141
151
These methods create new C < Seq > -based callbacks.
142
152
143
- The first form produces an infinite C < Seq > by calling C < &body > each time a new
153
+ In general, it produces an infinite C < Seq > by calling C < &body > each time a new
144
154
element is requested, using the return value from C < &body > as the item. This
145
155
emulates (or implements) a C < loop { body } > construct.
146
156
147
- The second form calls C < &cond > before each call to C < &body > , and terminates
157
+ When the multi includes C < &cond > , it's invoked before each call to
158
+ C < &body > , and terminates
148
159
the sequence if C < &cond > returns a false value. If C < $repeat > is set to a true
149
160
value, the first call to C < &cond > is omitted, and C < &body > called right away.
150
161
This emulates (or implements) C < while cond { body } > and
151
162
C < repeat { body } while cond > loops.
152
163
153
- The third form enables C-style looping by calling a third callback,
154
- C < &afterward > , after each call to C < &body > .
164
+ If present, C < &afterward > will be called after each call to C < &body > .
155
165
156
166
= head2 method sink
157
167
0 commit comments