@@ -15,8 +15,8 @@ Synopsis 3: Perl 6 Operators
15
15
16
16
Created: 8 Mar 2004
17
17
18
- Last Modified: 27 Feb 2012
19
- Version: 239
18
+ Last Modified: 28 Feb 2012
19
+ Version: 240
20
20
21
21
=head1 Overview
22
22
@@ -2141,8 +2141,7 @@ eager' list, any sequence that terminates with an exact value (or
2141
2141
that starts another sequence with exact values) is considered finite,
2142
2142
as is any sequence that has an explicit ending closure.
2143
2143
However, any sequence that ends C<*> is considered to be of unknowable
2144
- length (even if generated with a closure that has internal logic to
2145
- terminate). However, by the definition of "mostly eager" in L<S07>,
2144
+ length. However, by the definition of "mostly eager" in L<S07>,
2146
2145
the implementation may be able to determine that such a sequence is
2147
2146
finite by conjectural evaluation; such workahead cannot, of course,
2148
2147
prove that a sequence is infinite without running a Very Long Time.
@@ -2161,6 +2160,12 @@ infinite list in contexts which care. Similarly, any list ending
2161
2160
with an operator that interprets C<*> as infinity may be taken the
2162
2161
same way, such as C<$n xx *>, or C<1..*>.
2163
2162
2163
+ On the other hand, it's possible to write a sequence that appears to be
2164
+ infinite, but is terminated by a C<last> from the iterator closure. An
2165
+ implementation is required to trap such a loop termination and change the
2166
+ status of the list from 'infinite' to 'finite, such that C<.elems> reports
2167
+ the actual produced length, not C<Inf>.
2168
+
2164
2169
=item *
2165
2170
2166
2171
C<< infix:<E> >>, test for EMPTY iterator
0 commit comments