From: "David A. Black" Date: 2004-09-30T19:04:00+09:00 Subject: Re: Too Many Ways? Hi -- On Thu, 30 Sep 2004, Robert Klemme wrote: > "Gavin Kistner" schrieb im Newsbeitrag > news:C3144C65-1285-11D9-BDE2-000A959CF5AC@refinery.com... > > At what point do you cross over from: > > "Various ways to accomplish the same goal is good, > > because it allows the language to work the way > > different people think about working." > > into the land of: > > "Duplicate names and techniques to do the same > > atomic thing ends up confusing the nubys" > > ? > > > > results = my_array.collect{ ... } > > results = my_array.map{ ... } > > IMHO these were introduced to match other languages notations. I think it > makes life easier for newcomers. If only the things that make life easier for newcomers could disappear later, like training wheels on a bicycle.... :-) Personally I've never minded the handful of duplicate method names, though I know some people do. > > a = Proc.new{ ... } > > b = lambda{ ... } > > Same here. Proc.new and lambda aren't the same as each other, though: irb(main):014:0> l = lambda {|a,b|} => # irb(main):015:0> pr = Proc.new {|a,b|} => # irb(main):016:0> l.call(1) ArgumentError: wrong number of arguments (1 for 2) from (irb):14 from (irb):14:in `call' from (irb):16 irb(main):017:0> pr.call(1) => nil > > def whee; ...; end > > c = self.method( :whee ) > > These are two completely different cups of tea. I think these two lines go together: Gavin was showing that a method, like a block, lambda, or Proc, could be assigned to a variable. I tend to feel that the [block, lambda, Proc, method] stuff is too complicated. But I know Matz is working on it; hopefully there will be some unification/simplification to come. David -- David A. Black dblack@wobblini.net