From: Sigurd Date: 2012-01-17T03:08:07+09:00 Subject: Re: uniq with count; better way? Well, it seems not quite accurate to me because of block. inject uses convention that the last statement in method is a return. The nature of inject is to assign the last value to the memo that has not been used ever in your case. Therefore it's more natural to use short inject method definitions: either a.inject(5, :+) either 5 + a.inject(:+). If the memo return in proc would be unnatural the inject won't pass it to the proc explicitly. On the other side I'm not a proponent of the crazy injects that could be barely understood. I think in this case inject could be used easily as well as the other solutions provided. On Jan 16, 2012, at 6:14 PM, Adam Prescott wrote: > On Jan 16, 2012 4:09 PM, "Sigurd" wrote: >> >> You example is not accurate though: >> >> 5 + [1, 2, 3, 4].reduce(&:+) >> > > In what sense is that more "accurate"?