Skip to content

Instantly share code, notes, and snippets.

@moritz
Created December 11, 2012 12:35
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 moritz/4258258 to your computer and use it in GitHub Desktop.
Save moritz/4258258 to your computer and use it in GitHub Desktop.
Remaining sink problem
my @a = [<A B>], 'Z';
my @res := gather for @a {
if $_ ~~ Array {
take $_ for @$_;
} else {
take ~$_;
}
}
say @res.perl;
# OUTPUT:
# ("Z", "A", "B").list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment