Skip to content

Instantly share code, notes, and snippets.

Created October 8, 2010 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/617081 to your computer and use it in GitHub Desktop.
Save anonymous/617081 to your computer and use it in GitHub Desktop.
pmichaud@plum:~/rakudo$ cat xyz
sub arr($key, $value) {
Pair.new( key => $key, value => $value.item );
}
my $x = arr('a', (4,5,6));
say $x.value.list;
my $y = arr('a', (4,5,6).item);
say $y.value.list;
my $z = arr('a', Seq.new(4,5,6).item);
say $z.value.list;
pmichaud@plum:~/rakudo$ ./perl6 xyz
4 5 6
456
456
pmichaud@plum:~/rakudo$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment