From: "marcandre (Marc-Andre Lafortune)" Date: 2012-11-27T14:39:26+09:00 Subject: [ruby-core:50199] [ruby-trunk - Feature #6499] Array::zip Issue #6499 has been updated by marcandre (Marc-Andre Lafortune). I've thought a bit about this, and the proposed `Array.zip` basically already exists if all arrays have the same length. It's called `Array#transpose` :-) Array.zip([1,2,3], [4,5,6]) == [[1,2,3], [4,5,6]].transpose Note that the case of `Array.zip()` could be debated, but, as explained in https://bugs.ruby-lang.org/issues/6852, `[]` == `[].transpose` is the best answer. Because of this, it seems there is a lesser need for `Array.zip`. On the other hand, I am still confident that `Array.product` or similar, would be helpful. I hope I won't offend anyone by opening a new request. ---------------------------------------- Feature #6499: Array::zip https://bugs.ruby-lang.org/issues/6499#change-34009 Author: prijutme4ty (Ilya Vorontsov) Status: Rejected Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: core Target version: 2.0.0 Sometimes it's more natural to have Array::zip rather than Array#zip. Otherwise first array of list became unnecessary dedicated For example cols = first_row.zip(second_row,third_row,fourth_row) have more natural analog: cols = Array.zip(first_row,second_row,third_row,fourth_row) Implementation is obvious: def Array.zip(first,*rest) first.zip(*rest) end -- http://bugs.ruby-lang.org/