Skip to content

Commit b8192af

Browse files
authored
Merge pull request #3183 from dumarchie/#3163
Improve some Seq method definitions
2 parents 9b2123c + a2295e4 commit b8192af

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

doc/Type/Seq.pod6

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,19 @@ Creates a new C<Seq> object from the iterator passed as the single argument.
7676
7777
method iterator(Seq:D: --> Iterator:D)
7878
79-
Returns the underlying iterator, and marks the invocant as consumed.
80-
If called on an already consumed sequence, throws an error of type
81-
L<X::Seq::Consumed|/type/X::Seq::Consumed>.
79+
If the C<Seq> is not cached, returns the underlying iterator and marks
80+
the invocant as consumed. If called on an already consumed sequence,
81+
throws an error of type L<X::Seq::Consumed|/type/X::Seq::Consumed>.
82+
83+
Otherwise returns an iterator over the cached list.
8284
8385
=head2 method is-lazy
8486
8587
method is-lazy(Seq:D: --> Bool:D)
8688
87-
Returns C<True> if and only if the underlying iterator guarantees lazy
88-
evaluation and has not been completely evaluated. If called on an
89-
already consumed sequence, throws an error of type
90-
L<X::Seq::Consumed|/type/X::Seq::Consumed>.
89+
Returns C<True> if and only if the underlying iterator or cached list
90+
considers itself lazy. If called on an already consumed sequence, throws
91+
an error of type L<X::Seq::Consumed|/type/X::Seq::Consumed>.
9192
9293
=head2 method elems
9394
@@ -98,7 +99,7 @@ predicted, the C<Seq> is cached and evaluated till the end.
9899
99100
Because an infinite sequence cannot be evaluated till the end, such a
100101
sequence I<should> be declared lazy. Calling C<.elems> on a lazy C<Seq>
101-
throws an error of type L<X::Cannot::Lazy|/type/X::Cannot::Lazy>.
102+
L<fails|/routine/fail> with L<X::Cannot::Lazy|/type/X::Cannot::Lazy>.
102103
103104
=head2 method eager
104105

0 commit comments

Comments
 (0)