Created
April 28, 2012 11:39
-
-
Save jnthn/2518262 to your computer and use it in GitHub Desktop.
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; | |
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