Created
February 6, 2015 08:24
-
-
Save Tux/22f8ced78cf9dc87db69 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
#!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); | |
for @aka -> $alias { | |
$r.package.^add_method ($alias, $r); | |
} | |
} | |
alias ("foo", < bar >); | |
alias ("foo", < buz wru >); | |
} | |
} | |
C.foo ("foo"); | |
C.bar ("bar"); | |
C.wru ("wru"); | |
=> | |
CHECK | |
foo | |
Cannot find method 'postcircumfix:<( )>' | |
in block <unit> at x.pl:26 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment