role tree{
method bark(){...}
}
role dog{
method bark(){...}
}
class dog_tree does tree does dog{
method dog::bark(){ say "woof" }
method tree::bark(){ say "rough" }
}
sub pet_dog( my dog $dog ){
$dog.bark;
# actually calls
# $dog.meta.does(dog).bark
# $dog.dog::bark
# or something similar
}
Thursday, May 7, 2009
Multiple colliding roles
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment