Advertisement
happy-barney

p6 - literal hash

Oct 4th, 2019
3,240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.25 KB | None | 0 0
  1. my $a = %( a => [ ${ b => "c" } ] );
  2.  
  3. say WHAT $a;        # Hash
  4. say WHAT $a<a>;     # Array
  5. say WHAT $a<a>[0];  # Hash
  6.  
  7. my $b = %( a => [ %( b => "c" ) ] );
  8.  
  9. say WHAT $b;        # Hash
  10. say WHAT $b<a>;     # Array
  11. say WHAT $b<a>[0];  # Pair
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement