Created
November 24, 2011 15:59
-
-
Save gfldex/1391681 to your computer and use it in GitHub Desktop.
overloading <( )> error without line number
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; | |
class Signal { | |
has @.slots is rw; | |
multi method connect(Code $f){ | |
@.slots.push($f); | |
return self; | |
} | |
multi method connect($obj, $f){ | |
@.slots.push(sub ($c){$obj.$f(|$c)}); | |
return self; | |
} | |
multi method postcircumfix:<( )>(){ | |
$.slots>>.(); # HERE BE DRAGONS | |
} | |
} | |
### output: | |
### ===SORRY!=== | |
### Method 'isa' not found for invocant of class 'Undef' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment