Skip to content

Instantly share code, notes, and snippets.

@kuzuha
Created April 28, 2013 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuzuha/5477051 to your computer and use it in GitHub Desktop.
Save kuzuha/5477051 to your computer and use it in GitHub Desktop.
./perl6
> class t{}
t()
> role r{method hello{say 'hello'}}
r()
> class t_r does r {}
t_r()
> t_r.new().hello()
hello
> (t.new does r).hello()
hello
> t.new.^add_role(r).hello()
hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment