On Monday 02 August 2004 12:26, Mike Hall wrote:
>
> 1. A new method, Array.combine  (needs a better name for general use).
>    It takes entries from two (or many) arrays and combines them.
>    (like a combination of Array.zip, fetch, and map)
>
>    For my use, I needed multiplication, but a block would be more general.
>
>         a = [1,2,3]
>         b = [1,3,5]
>         a.combine(b)    => [1,6,15]
>
>    Or with a block:
>
>         a.combine(b) {|x,y| x*y}

Or perhaps:

c = a.weave(b)
c #=> [[1, 1], [2, 3], [3, 5]]

...then you could:

c.collect! do {|item| item[0] * item[1]}

c #=> [1, 6, 15]

	Sean O'Dell