[Ironruby-core] Delegates (agian)

Curt Hagenlocher curt at hagenlocher.org
Thu Oct 25 18:31:22 EDT 2007

On 10/25/07, Dermot Hogan <lists at ruby-forum.com> wrote:
> You can't say
> x = new EventHandler(mymethod)

I was trying to avoid writing this, but my inner pedant simply won't let
go.  There's a difference between delegates and events.  A delegate is
simply a bound function pointer, and it's perfectly legal to do a
straightforward assignment as above.  An event is basically a published
endpoint to which you subscribe and unsubscribe by adding and removing your
delegate.  The two are obviously related but not the same, and what we seem
to be talking about here specifically involves events.

I feel much better now. :)

Curt Hagenlocher
curt at hagenlocher.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20071025/37b292fc/attachment.html 

More information about the Ironruby-core mailing list