< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #10903 has been updated by marcandre (Marc-Andre Lafortune).
Wow, time flies. Sorry for not addressing this earlier.
I have some commits ready to address this: https://github.com/ruby/ruby/pull/1746
Naming: The issue I have with `zip` is not really the potential incompatibility, but that the builtin `zip` (at least in my head) does a kind of transposition, while it wouldn't for matrices (or it would do two, if you want to see it this way). Also, `Array#zip` is lax on sizes (you can zip arrays of different sizes). Finally, I would imagine that the result of `zip` for Matrices will *always* be chained with `map`, while `Array#zip` has other uses (`keys.zip(values).to_h`).
So I'm proposing `combine` instead, that takes a block (or returns an Enumerable).
What do you think?
----------------------------------------
Feature #10903: [PATCH] Matrix#zip returns a matrix
https://bugs.ruby-lang.org/issues/10903#change-67732
* Author: LitoNico (Lito Nicolai)
* Status: Assigned
* Priority: Normal
* Assignee: marcandre (Marc-Andre Lafortune)
* Target version:
----------------------------------------
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/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>