Skip to content

Instantly share code, notes, and snippets.

@peschwa
Created July 23, 2016 07:09
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 peschwa/22815eefdf64efcc181abcddd31d4952 to your computer and use it in GitHub Desktop.
Save peschwa/22815eefdf64efcc181abcddd31d4952 to your computer and use it in GitHub Desktop.
class A { };
A.^add_method('foo', my method () { "foo" });
A.^compose;
say A.foo;
my \Foo = $;
Foo = class :: { };
my $x = Foo.new;
Foo = class :: { method foo { "foo" } };
my $y = Foo.new;
say $y.foo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment