Re: Stealing a good idea from Gtk#

* muppet <scott asofyet org> [2004-09-27 03:46]:
in defense of the += operator, the += makes sense because you
can connect any number of handlers to a signal, while = implies
a Highlander nature ("there can be only one!").

I know. Just deciding that "+= means you can ``add'' more than
one signal handler" smells like overloading-because-I-can,

how would you handle variants like connect-after and user data?

connect-after could simply be taken care of using an extra, near-
identical SIGNAL::AFTER package.

User data would be rather more tricky.. in Gtk# you're passing in
an object, not merely a coderef, so it's not a problem. Of
course, in a language that has closures, you don't *need* to be
able to pass user data..

"If you can't laugh at yourself, you don't take life seriously enough."

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]