Created
April 27, 2012 17:58
-
-
Save anonymous/2511334 to your computer and use it in GitHub Desktop.
empty capture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
#> Too many positional parameters passed; got 1 but expected 0 | |
#> in sub somesub at empty_capture.p6:3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment