[Ironruby-core] delegate

Mike Plavsky Mike.Plavsky at quest.com
Mon Feb 4 07:30:27 EST 2008


Does IronRuby work with rspec?


-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Michael Letterle
Sent: Monday, February 04, 2008 3:29 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] delegate

You /could/ do:

rbutton.Click {|sender, e| onClick sender}
rbutton2.Click {|sender, e| onClick sender}

Though that's still not "true" delegation :)

On Feb 4, 2008 5:56 AM, Huw Collingbourne <lists at ruby-forum.com> wrote:
> Michael Letterle wrote:
> > What I'm saying is eventually you'll be able to something like
> >
> > rbutton.Click{|sender, e| puts "Clicked!"}
> > rbutton.Click{|sender, e| puts "Also Clicked!"}
> >
>
> That's still not quite delegation in the usual sense. What if we have:
>
> def onClick( sender )
>   # do something
> end
>
> ...then have this single method 'wired up' to the Click events on, say,
> the 50+ buttons of a scientific calculator? In short, the delegated
> methods need to be detached from specific objects. I'm sure the IronRuby
> team will provide this in time. It makes a big difference when it comes
> to implementing code+form integration ;-)
>
>
> best wishes
> Huw
>
> SapphireSteel Software
> Ruby and Rails In Visual Studio
> http://www.sapphiresteel.com
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>



--
Michael Letterle
[Polymath Programmer]
http://michaeldotnet.blogspot.com
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core


More information about the Ironruby-core mailing list