From: thufir Date: 2008-04-02T05:20:03+09:00 Subject: Re: inject's pathological case... On Mon, 31 Mar 2008 10:06:59 +0900, Julian Leviston wrote: > # example program to illustrate inject num_ary = [10,37,27,398,273,28] > > # summing without inject: > without_inject_sum = 0 > num_ary.each{|num| without_inject_sum += num} > > # summing with inject > with_inject_sum = num_ary.inject{|sum, num| sum + num} Thank you for the example. I'm not convinced that inject is fantastic, but certainly it's something I need to understand and this example helps to illuminates it. -Thufir