Feature #4539

Updated by nobu (Nobuyoshi Nakada) almost 2 years ago

Inspired by Haskell's `zipWith` ((|zipWith|)) function, I hacked on together for Ruby:


[1,2,3].zip_with([6,5,4], :+) #=> [7, 7, 7]

[1,2,3].zip_with([6,5,4]) { |a,b| 3*a+2*b } #=> [15, 16, 17]

So far I only have a Ruby version of it:

My questions:

1. Would this method be considered a worthwhile addition to `Array`? Array?

2. I've never hacked on the C side of Ruby (read some parts of the source though) and my C is quite rusty. I'd like to change that, would somebody be willing to help me turn this into a proper patch?