is-lazy
ErrorsCollection

is-lazy

Synthesised documentation from type/HyperSeq type/Iterator type/RaceSeq type/Seq

From type/HyperSeq

See Original text in context

method is-lazy(--> False )

Returns False.

From type/Iterator

See Original text in context

method is-lazy(Iterator:D: --> Bool:D)

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.

From type/RaceSeq

See Original text in context

method is-lazy(--> False )

Returns False.

From type/Seq

See Original text in context

method is-lazy(Seq:D:)

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.