[#122258] [Ruby Misc#21367] Remove link to ruby-doc.org from www.ruby-lang.org/en/documentation/ — "p8 (Petrik de Heus) via ruby-core" <ruby-core@...>
Issue #21367 has been reported by p8 (Petrik de Heus).
11 messages
2025/05/23
[ruby-core:122156] [Ruby Feature#4539] Array#zip_with
From:
"matheusrich (Matheus Richard) via ruby-core" <ruby-core@...>
Date:
2025-05-16 20:47:27 UTC
List:
ruby-core #122156
Issue #4539 has been updated by matheusrich (Matheus Richard).
@matz maybe too obvious, but how about `zip_map`?
----------------------------------------
Feature #4539: Array#zip_with
https://bugs.ruby-lang.org/issues/4539#change-113305
* Author: citizen428 (Michael Kohl)
* Status: Assigned
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
Inspired by Haskell's `zipWith` function, I hacked on together for Ruby:
```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:
https://gist.github.com/731702b90757e21cadcb
My questions:
1. Would this method be considered a worthwhile addition to `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?
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/