Project

General

Profile

Actions

Feature #5145

closed

Function extension of Array#transpose

Feature #5145: Function extension of Array#transpose

Added by metanest (Makoto Kishimoto) about 14 years ago. Updated almost 8 years ago.

Status:
Feedback
Assignee:
-
Target version:
-
[ruby-core:38701]

Description

Currently, Array#transpose doesn't transpose iliffe vector that
size of arrays in array are not same.

But iff the sequence of size is monotone nonincreasing, there is
natural transposition.

[[1, 2, 3], [4, 5], [6]].transpose
=> [[1, 4, 6], [2, 5], [3]]

Attachment is monkey patch implementation by Ruby .


Files

array-transpose.rb (821 Bytes) array-transpose.rb metanest (Makoto Kishimoto), 08/02/2011 05:28 PM

Updated by mame (Yusuke Endoh) over 13 years ago Actions #1 [ruby-core:43699]

  • Status changed from Open to Feedback

Interesting but do you have any use case?

--
Yusuke Endoh

Updated by yhara (Yutaka HARA) almost 13 years ago Actions #2 [ruby-core:48278]

  • Target version changed from 2.0.0 to 2.6

Updated by naruse (Yui NARUSE) almost 8 years ago Actions #3

  • Target version deleted (2.6)
Actions

Also available in: PDF Atom