From: Gregor Kopp Date: 2006-08-07T17:25:10+09:00 Subject: Re: inject does not inject last value Hm... irb(main):001:0> a = 0 => 0 irb(main):002:0> a + 1 => 1 irb(main):003:0> a => 0 irb(main):004:0> a = a + 1 => 1 irb(main):005:0> a => 1 no. it matters if you get the return value or assign a value. Pe�a schrieb: > fr joey: > # Whats wrong with: > # sum = [1,2,3,4,5].inject{|sum,e| sum+e } ? > > dry. > i still think inject should update sum before exit. > > kind regards -botp >