From: Mike Gold Date: 2009-01-12T07:48:52+09:00 Subject: Re: functional programming Brian Candler wrote: > (2) to understand Mike's assertion > that Ruby lambdas are not first-class functions (i.e. "The difference > between lambda { } and a real first-class function is quite profound"). Ruby: mean = lambda { |*args| (args.inject(0) { |acc, x| acc + x })/args.size.to_f } data = [[1,2,3], [4,5,6,7]] data.map(&mean) # fail data.map(&:mean) # fail data.map { |*numbers| mean.call(*numbers) } # fail data.map { |numbers| mean.call(*numbers) } # phew, found it Haskell: map mean data On this example alone, I think my characterization of "quite profound" is justified. -- Posted via http://www.ruby-forum.com/.