Skip to content

Instantly share code, notes, and snippets.

@0racle
Created September 20, 2016 02:09
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 0racle/abf85e94b9ed752ea804106209365270 to your computer and use it in GitHub Desktop.
Save 0racle/abf85e94b9ed752ea804106209365270 to your computer and use it in GitHub Desktop.
Slurpy
#!/usr/bin/env perl6
sub plus( +@foo ) { "@foo.elems() elems: ", @foo }
sub star( *@foo ) { "@foo.elems() elems: ", @foo }
my @a = (1, 2),(3, 4);
my @b = (6, 7),(8, 9);
say plus(@a, 5, @b); # OUTPUT: (3 elems: [[(1 2) (3 4)] 5 [(6 7) (8 9)]])
say star(@a, 5, @b); # OUTPUT: (5 elems: [(1 2) (3 4) 5 (6 7) (8 9)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment