Issue #10903 has been updated by Marc-Andre Lafortune.

Tracker changed from Bug to Feature

Hi, sorry I missed your proposal until now, and thanks for the patch.

Could you explain in what kind of circumstances one would use this? I'm not sure I see what kind of mathematical operation this can correspond to.

----------------------------------------
Feature #10903: [PATCH] Matrix#zip returns a matrix
https://bugs.ruby-lang.org/issues/10903#change-52582

* Author: Lito Nicolai
* Status: Assigned
* Priority: Normal
* Assignee: Marc-Andre Lafortune
----------------------------------------
Currently:
    > x = Matrix.I 2
    > x.zip x
    => [[1, 1], [0, 0], [0, 0], [1, 1]] # It's an array!

With the patch:
    > x.zip x
    => Matrix[[1, 1], [0, 0], [0, 0], [1, 1]]

And also:
    > x.zip x, x  # and so on
    => Matrix[[1, 1, 1], [0, 0, 0], [0, 0, 0], [1, 1, 1]]


---Files--------------------------------
matrix_zip.patch (1.42 KB)


-- 
https://bugs.ruby-lang.org/