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
#!perl6 | |
use v6; | |
use Slang::Tuxic; | |
class C { | |
method foo (Str $s) { | |
$s.say; | |
} | |
CHECK { "CHECK".say; | |
sub alias (Str:D $m, *@aka) { | |
my $r := C.^find_method ($m); | |
my $p := $r.package; | |
$p.^add_method ($_, $r) for @aka; | |
} | |
alias ("foo", < bar >); | |
alias ("foo", < buz wru >); | |
} | |
} | |
C.foo ("foo"); | |
C.bar ("bar"); | |
C.wru ("wru"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment