From: Gary Wright Date: 2007-07-10T03:53:00+09:00 Subject: Re: Choice of the word On Jul 4, 2007, at 10:26 AM, Gareth Adams wrote: > Wayne E. Seguin gmail.com> writes: > >> The word Inject essentially means to introduce something into a >> system and yet the inject method iterates over a series elements >> carrying forward some sort of result at each next step. >> >> Hence would it not make more sense to name it " accumulate" which >> seems to me more explicit and intuitive? > > The best I could ever come up with is that the function is > `injected` between > the elements of the object Yes. For me, this rationale becomes clear when you see that [1,2,3,4].inject { |a,i| a + i } is the same as (1 + 2 + 3 + 4) The binary operator 'plus' has been injected between all the elements of the collection. Gary Wright