Perl 6 Perl 6 Lists and Arrays vivified #28

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 © 2012
http://www.pmichaud.com/2012/pres/