From: Travis Whitton Date: 2003-03-27T00:08:18+09:00 Subject: Re: How can one implement composition of functions in Ruby? > One of the most important issues for me is the ability to write in a > functional style of programing. So far I saw than python supports it > more but may be I'm wrong? Ruby does a fine job at functional programming. You can even do partial evaluation(aka currying): class Object def curry(symbol, *fixedArgs) lambda { |*args| method(symbol).call(*(fixedArgs + args)) } end end def sum(a, b) a + b end plus4 = curry(:sum, 4) plus4.call(5) # => 9 arrayOfFive = Array.curry(:new, 5) arrayOfFive.call("A") # => ["A", "A", "A", "A", "A"] See the Wiki page: http://www.rubygarden.org/ruby?FunctionalRuby for more examples. -Travis