On Sat, Jun 27, 2009 at 8:41 PM, Joel VanderWerf<vjoel / path.berkeley.edu> w= rote: > Gregory Brown wrote: >> >> On Sat, Jun 27, 2009 at 4:52 PM, Fabian >> Streitel<karottenreibe / googlemail.com> wrote: > > ... >>>> >>>> def name(*args) >>>> =A0 =A0 =A0return @name if args.empty? >>>> =A0 =A0 @name =3D args.first >>>> end >>> >>> Better, but IMHO that's WAY too much overhead for something as basic as= a >>> setter. >>> After all, you have to construct an array everytime you access the >>> setter... >> >> Huh? =A0This is the way Ruby arguments work no matter what. =A0Using *ar= gs >> just gives you raw access to the arguments. > > No, *args does construct an array. Interesting. Does this really matter though? I know that GC is slow in Ruby but just how soon would this become a problem in practical applications. (I suppose it depends on the application) -greg