-
-
Save cygx/23638f780f77ba032d21f600d8f7d2cd 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
role Constructor[*@params] { | |
method CALL-ME(::?CLASS:U: *@args where +@params) { | |
%_{@params} = @args; | |
self.bless: |%_; | |
} | |
} | |
multi trait_mod:<is>(Mu:U $_, :contor($params)!) { | |
.^add_role: Constructor[@$params]; | |
} | |
class Point is contor<x y> { | |
has $.x; | |
has $.y; | |
} | |
say Point(1, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment