Perl 6 lazy list example #2
Example of laziness inaction:
my @words = < postmodern modern romantic baroque classical >; my $upwords = map { say "loop"; ucfirst $_ }, @words; say "Hello"; say $upwords[2];
What we naively expect: What we likely get:
loop Hello loop loop loop loop loop loop loop Romantic Hello Romantic