Documentation for method is-lazy

Documentation for method is-lazy, assembled from the following types:

role Iterator

From Iterator

(Iterator) method is-lazy

Defined as:

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

Returns 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 .. Inf).is-lazy# OUTPUT: «True␤» 

class Seq

From Seq

(Seq) method is-lazy

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

Returns True if the sequence is lazy and potentially infinite, and False otherwise. If called on an already consumed sequence, throws an error of type X::Seq::Consumed.