Perl 6 Perl 6 Lists and Arrays vivified #26

Perl 6 lazy list example #2

Example of laziness inaction:

my @words = < orange lime cherry banana lemon >;

my $upwords = map { say "loop"; ucfirst $_ }, @words;

say "Hello";
say $upwords[2];

What we naively expect:

loop               
loop              
loop             
loop            
loop           
Hello
Cherry
Copyright © 2012
http://www.pmichaud.com/2012/pres/