happy-barney

p6 - hash and ROUTINE

Oct 6th, 2019
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.24 KB | None | 0 0
  1. sub foo {
  2.     return %(
  3.         '%()' => %( &?ROUTINE.name => "bar" ),
  4.         '${}' => ${ &?ROUTINE.name => "bar" },
  5.         '{}'  => { &?ROUTINE.name => "bar" },
  6.     );
  7. }
  8.  
  9. say foo;
  10.  
  11. Output:
  12. {${} => {<unit> => bar}, %() => {foo => bar}, {} => {<unit> => bar}}
Add Comment
Please, Sign In to add comment