Skip to content

Instantly share code, notes, and snippets.

@samuraisam
Last active December 18, 2015 20:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save samuraisam/5843391 to your computer and use it in GitHub Desktop.
role protobuf[Str $file] {
has $.file is rw;
}
multi trait_mod:<is>(Any $type, :$protobuf!) is export(:DEFAULT, :traits) {
say "I POOP";
$type does protobuf[$type];
}
class Monkey is protobuf('hello') { }
say 'monkey: ', Monkey;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment