method is-lazy
1 | class HyperSeq |
1.1 | (HyperSeq) method is-lazy |
2 | class RaceSeq |
2.1 | (RaceSeq) method is-lazy |
3 | class Seq |
3.1 | (Seq) method is-lazy |
4 | role Iterator |
4.1 | (Iterator) method is-lazy |
Documentation for method is-lazy
assembled from the following types:
class HyperSeq
From HyperSeq
(HyperSeq) method is-lazy
method is-lazy(--> False )
Returns False
.
class RaceSeq
From RaceSeq
(RaceSeq) method is-lazy
method is-lazy(--> False )
Returns False
.
class Seq
From Seq
(Seq) method is-lazy
method is-lazy(Seq: --> Bool)
Returns True
if and only if the underlying iterator or cached list considers itself lazy. If called on an already consumed sequence, throws an error of type X::Seq::Consumed.
role Iterator
From Iterator
(Iterator) method is-lazy
Defined as:
method is-lazy(Iterator: --> Bool)
Should return True
for iterators that consider themselves lazy, and False
otherwise.
Built-in operations that know that they can produce infinitely many values return True
here, for example (1..6).roll(*)
.
say (1 .. 100).is-lazy; # OUTPUT: «False»say (1 .. ∞).is-lazy; # OUTPUT: «True»
The Iterator role implements this method returning False
, indicating a non-lazy iterator.