Perl 6 More laziness and lists #11

map / for equivalence

In Perl 6

for @list { block }

is the same as

(@list,).map({ block })

Sink context can force eager evaluation of the for or map

In Rakudo, the for statement is actually syntactic sugar for the above .map construct.

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