From: Gregory Brown Date: 2006-07-05T11:36:31+09:00 Subject: Re: Parallel Array On 7/4/06, Matthew Smillie wrote: > # using inject is fun. Let's do it again. > c = (0...a.length).inject([]) { |x, n| x << a[n] + b[n] } better would be c = (0...a.length).inject([]) { |x, n| x + [ a[n] + b[n] ] } The example you showed breaks the functional aspect of inject. (it is doing double assignment) I just learned to avoid this myself....