Created
August 22, 2009 11:37
-
-
Save jnthn/172753 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
multi trait_mod:<is>(AttributeDeclarand $a, $value, :$type-object-valued) { | |
my $accessor_name = $a.name.substr(2); | |
my $meth = method { self.defined ?? $value !! eval($a.name) }; | |
$a.how.add_method($a.how, $accessor_name, $meth); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment