Perl 6 Perl 6 Lists and Arrays vivified #18

Item contexts

Use "$" or ".item" to force the item (scalar) form of an object

my @a = 1,2,3;
my @b = 10,20,30;

my @one = @a, @b;         # 1,2,3,10,20,30
say @one.elems;           # 6

my @two = $(@a), $(@b)    # [1,2,3], [10,20,30]
say @two.elems;           # 2

say @two.perl;            # Array.new([1,2,3], [10,20,30])
Copyright © 2012
http://www.pmichaud.com/2012/pres/