Perl 6 More laziness and lists #34

Handling infinity

A List delegates .infinite to its ListIter.

A ListIter (currently) returns the infinity of the next unreified thing.

(Speculation: ListIter could "scan ahead" for infinite items.)

When a ListIter is asked to reify eagerly, it stops when it encounters a "known infinite" Iterable.

 MapIter.infinite always reports Mu (current, may change)

(1..*).map( &block ).infinite      # Mu -- &block might abort
(1..5).map( &block ).infinite      # Mu -- &block might redo
Copyright © 2012
http://www.pmichaud.com/2012/pres/