Skip to content

Instantly share code, notes, and snippets.

@gfldex
Created November 24, 2011 15:59
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 gfldex/1391681 to your computer and use it in GitHub Desktop.
Save gfldex/1391681 to your computer and use it in GitHub Desktop.
overloading <( )> error without line number
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