Skip to content

Instantly share code, notes, and snippets.

Created April 27, 2012 18:01
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 anonymous/2511366 to your computer and use it in GitHub Desktop.
Save anonymous/2511366 to your computer and use it in GitHub Desktop.
use v6;
sub somesub(){
say "i haz a sub";
};
class Foo {
has @.a is rw;
method add(&c){ @.a.push(&c) }
method postcircumfix:<( )>($self: |c) {
#since i stripped self into $self, the capture should be empty
@.a>>.(|c)
}
}
my $foo = Foo.new;
$foo.add(&somesub);
$foo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment