Perl 6 Perl 6 Lists, Arrays, and Hashes vivified #27

How laziness works

Internally, lists have two parts:

Range example:

> my $r = 100..200; say $r.WHAT;
Range();

> say $r.reify(5).perl;
(100, 101, 102, 103, 104, 105..200)

The .reify method requests generation of $n elements

Lazy lists manage the generation of elements "on demand"

Copyright © 2011
http://www.pmichaud.com/2011/pres/