Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created September 22, 2014 14:56
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 jnthn/acad3207544f40b72be9 to your computer and use it in GitHub Desktop.
Save jnthn/acad3207544f40b72be9 to your computer and use it in GitHub Desktop.
multi trait_mod:<is>(Method $meth, :$notted!) {
my $name = $meth.name;
$meth.package.HOW.add_method: $meth.package, 'not-' ~ $name, method () {
not self."$name"()
}
}
class A {
method x() is notted {
True
}
}
my $o = A.new();
say $o.x;
say $o.not-x;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment