From: Sean O'Halpin Date: 2006-07-05T12:13:55+09:00 Subject: Re: Parallel Array On 7/5/06, Pe�a, Botp wrote: > > i do not go for faster, but maybe simpler to the eye, > > c=[] > a.each_index{|i| c << a[i]+b[i]} > > kind regards -botp > I like this: a.zip(b).map{|(x,y)| x + y} Not as fast as the Array.new(size) version, but the block doesn't need to know which arrays it's operating on. BTW, does anyone know why zip with a block returns nil? It would be handy to have it map. Regards, Sean