Martin DeMello
9/10/2008 5:10:00 PM
On Wed, Sep 10, 2008 at 9:35 AM, ara.t.howard <ara.t.howard@gmail.com> wrote:
>
> be careful with zip
>
> a = big
> b = big
>
> huge_new_array = a.zip(b)
>
> another_huge_new_array = huge_new_array.each{|a,b| a + b}
zip takes a block, even in 1.8, though sadly it yields without
accumulating so you have to do it yourself. but this works:
c = []; a.zip(b) {|i, j| c << f(i,j)}
martin