From: James Edward Gray II Date: 2005-10-20T05:29:03+09:00 Subject: Re: Functional with Ruby On Oct 19, 2005, at 1:59 PM, Ryan Leavengood wrote: > What's wrong with inject? I find this very readable and not any more > verbose than the Haskell: > > irb(main):001:0> a=[1,2,3,4,5,6,7] > => [1, 2, 3, 4, 5, 6, 7] > irb(main):002:0> a.inject(0){|i,sum| i+sum} > => 28 That can get a bit shorter too, since you don't need the (0) part. James Edward Gray II