From: Gary Boone Date: 2006-11-15T17:51:26+09:00 Subject: Re: Design problem with 'inject' Those are several good suggestions. next sum if (i == 3) strikes me as simple and clear. Provided you know that the block result is what matters, you can stay out of trouble. Simplifying the example, the trouble with inject is that arr.inject(0) { |sum, i| sum += i } arr.inject(0) { |sum, i| sum + i } both produce the same result. Yuk. Maybe it should be posted somewhere as a potential 'gotcha'. -- Posted via http://www.ruby-forum.com/.