From: "Berger, Daniel" Date: 2003-08-27T01:49:20+09:00 Subject: Re: Why did you switch from Python to Ruby? > -----Original Message----- > From: Schneider, Michael [mailto:michael.l.schneider@eds.com] > Sent: Tuesday, August 26, 2003 10:25 AM > To: ruby-talk@ruby-lang.org > Subject: Re: Why did you switch from Python to Ruby? > Ruby Issues: > - named parameters (is this in 1.8?), these are really > handy for GUI objects > with many valid options that are partially set by the user. Easy enough to do as is with a block, provided the package author simply provides a "yield self if block_given?". e.g. class Foo_Widget attr_accessor :height, :border, :bgcolor def initialize yield self if block_given? end end o = Foo_Widget.new{ |f| f.height = 10 f.border = 2 f.bgcolor = "red" } p o -> # Regards, Dan