From: Joel VanderWerf Date: 2007-03-26T07:03:33+09:00 Subject: Re: Backus, Functional Programming, and Ruby Jesse Merriman wrote: ... > # Test case from the lecture. Should print out 28. > puts inner_product.call([[1,2,3], [6,5,4]]) > --------------------------------------------------------------------- Ruby has its own way of doing things, not that there is anything wrong with defining new ways: [[1,2,3], [6,5,4]].transpose.map{|x,y|x*y}.inject{|s,x|s+x} => 28 -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407