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

List assignment is eager

List assignment is eager by default:

my @words = < postmodern modern romantic baroque classical >;

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

# eagerly evaluated
my @uparray = map { say "loop"; ucfirst $_ }, @words;

Sink (void) context is also eager

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