Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created April 28, 2012 11:39
Show Gist options
  • Save jnthn/2518262 to your computer and use it in GitHub Desktop.
Save jnthn/2518262 to your computer and use it in GitHub Desktop.
use v6;
multi trait_mod:<is>(Method $m, :$signal!){
#proto handle_call(|$) { * }
multi handle_call(|$args){
say $m.WHAT;
}
$m.wrap(&handle_call);
}
multi sub connect($sender, Method $signal, $rcpt, Method $slot){
(&$signal).connect($sender, $rcpt, $slot);
}
class Button {
our method pressed is signal { warn "signal fired" }
}
my Button $btn_exit .= new;
$btn_exit.pressed;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment