perl6: hash小笔记
1 > my %h = 1,2,3,4
2 {1 => 2, 3 => 4}
3 > my $a = :%h
4 h => {1 => 2, 3 => 4}
5 > $a.perl
6 :h({"1" => 2, "3" => 4})
7 > my %h2 = 'a','b'
8 {a => b}
9 > my $a = :%h,:%h2
10 (h => {1 => 2, 3 => 4} h2 => {a => b})
11 > $a.perl
12 :h({"1" => 2, "3" => 4})
13 > $a.Str
14 h 1 2
15 3 4
16 > $a
17 h => {1 => 2, 3 => 4}
18 > $a<h2>
19 Nil
20 > $a<h>
21 {1 => 2, 3 => 4}
22 > my $a = (:%h,:%h2)
23 (h => {1 => 2, 3 => 4} h2 => {a => b})
24 > $a.WHAT
25 (List)
26 > $a
27 (h => {1 => 2, 3 => 4} h2 => {a => b})
28 > $a.perl
29 $(:h({"1" => 2, "3" => 4}), :h2({:a("b")}))
30 >