Skip to content

Instantly share code, notes, and snippets.

@colomon
Created June 28, 2013 02:42
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 colomon/5882090 to your computer and use it in GitHub Desktop.
Save colomon/5882090 to your computer and use it in GitHub Desktop.
multi method categorize( &test, *@list ) {
fail 'Cannot .categorize an infinite list' if @list.infinite;
for @list {
say $_;
for test($_) -> $k {
say :$k.perl;
say "blue" ~ $_;
self{$k}.push: 1;
say self{$k}.perl;
}
}
self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment