In role Iterator§
See primary documentation in context for method is-lazy
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).iterator.is-lazy; # OUTPUT: «False»say (1 .. ∞).iterator.is-lazy; # OUTPUT: «True»
The Iterator role implements this method returning False
, indicating a non-lazy iterator.
In Seq§
See primary documentation in context for method is-lazy
method is-lazy(Seq:)
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
.
In RaceSeq§
See primary documentation in context for method is-lazy
method is-lazy(--> False )
Returns False
.
In HyperSeq§
See primary documentation in context for method is-lazy
method is-lazy(--> False )
Returns False
.