From: Michal 'hramrach' Suchanek Date: 2005-07-20T06:40:07+09:00 Subject: Re: ] Re: Ruby has ruined my Java (was Re: Ruby has ruined my C++) On Tue, Jul 19, 2005 at 06:55:23AM +0900, Jacob Fugal wrote: > On 7/18/05, Daniel Amelang wrote: > > Let's say that I have this...friend...um yea. And this 'friend' was > > tossing around ideas about what a rubyesque GUI toolkit API would look > > like. What would people think of something like this for event > > handling?: > > > > ... > > button.when_pushed do > > puts "Hey, don't push my buttons!" > > end > > ... > > I, personally, would prefer something more along the lines: > > button.on_event( :push ) do > puts "Hey, don't push my buttons!" > end This looks like it is more flexible .. but it requires the user of the library to write a dispatcher function. And since ruby is dynamic you do not need to force users into writing dispatchers to get flexibility. So I like the first one better. Thanks Michal Suchanek