Skip to content

Instantly share code, notes, and snippets.

@FROGGS
Created January 5, 2016 10:24
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 FROGGS/1a5122a8db23a49d128b to your computer and use it in GitHub Desktop.
Save FROGGS/1a5122a8db23a49d128b to your computer and use it in GitHub Desktop.
~/dev/rakudo$ grep -R 'add_method' t/*
t/03-jvm/01-interop.t: CRC32.HOW.add_method(CRC32, "doubledValue", method ($self:) {
t/spec/S12-introspection/meta-class.rakudo.jvm: A.^add_method('bar', A.^can('foo'));
t/spec/S12-introspection/meta-class.rakudo.jvm: dies-ok { A.new().bar() }, 'Using .^add_method with what .^can returns (a list) will never work';
t/spec/S12-introspection/meta-class.rakudo.jvm: A.^add_method('bar', A.^lookup('foo'));
t/spec/S12-introspection/meta-class.rakudo.jvm: is A.new().bar(), 'abc', 'Can .^add_method what .^lookup returns under another name and it works';
t/spec/S12-introspection/meta-class.t: A.^add_method('bar', A.^can('foo'));
t/spec/S12-introspection/meta-class.t: dies-ok { A.new().bar() }, 'Using .^add_method with what .^can returns (a list) will never work';
t/spec/S12-introspection/meta-class.t: A.^add_method('bar', A.^lookup('foo'));
t/spec/S12-introspection/meta-class.t: is A.new().bar(), 'abc', 'Can .^add_method what .^lookup returns under another name and it works';
t/spec/S12-class/basic.t: #?niecza todo 'Exception: Unable to resolve method add_method in type ClassHOW'
t/spec/S12-class/basic.t: eval-lives-ok 'Rat.^add_method("lol", method ($what) { say "lol$what" }) ~~ Method',
t/spec/S12-class/basic.t: 'add_method returns a Method object';
t/spec/S12-meta/grammarhow.t: $grmr.^add_method('TOP', token { <foo> });
t/spec/S12-meta/grammarhow.t: $grmr.^add_method('foo', $<bottom>.ast[0]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment