Perl 6 More laziness and lists #38

Hashes

In list contexts, Hash objects flatten to be List of Pair.

> my %h = (a => 'apple', b => 'banana', 'c' => 'cherry');
> for %h { $_.say }
a => apple
c => cherry
b => banana

> my @array = (1, 2, %h);
> say @array.elems
5
> say @array.perl
Array.new(1, 2, "a" => "apple", "b" => "banana", "c" => "cherry")
Copyright © 2012
http://www.pmichaud.com/2012/pres/