Created
May 8, 2010 06:44
-
-
Save uasi/394411 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
use v6; | |
use MONKEY_TYPING; | |
class C {} | |
role R { | |
method perl() { 'perl' } | |
method foo() { 'foo' } | |
} | |
augment class C does R {} | |
augment class Array does R {} | |
augment class Str does R {} | |
say C ~~ R; # 1 | |
say C.new.perl; # perl | |
say C.new.foo; # foo | |
say [] ~~ R; # 1 | |
say [].perl; # [] | |
say [].foo; # foo | |
say '' ~~ R; # 1 | |
say ''.perl; # "" | |
# say ''.foo; # ('foo' not found) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment