[Issue 17742] std.range.transposed does not have opIndex

2017-12-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17742

--- Comment #4 from github-bugzi...@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/ac29b7bada5ba51fe053f3d4e274eb3a0e2b3417
Fix Issue 17742 - std.range.transposed does not have opIndex

https://github.com/dlang/phobos/commit/b95f73a2c79689768b4a5d8df337882dccba844f
Merge pull request #5805 from Darredevil/issue-17742-transposed-opIndex

--


[Issue 17742] std.range.transposed does not have opIndex

2017-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17742

--- Comment #3 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/ac29b7bada5ba51fe053f3d4e274eb3a0e2b3417
Fix Issue 17742 - std.range.transposed does not have opIndex

https://github.com/dlang/phobos/commit/b95f73a2c79689768b4a5d8df337882dccba844f
Merge pull request #5805 from Darredevil/issue-17742-transposed-opIndex

Fix Issue 17742 - std.range.transposed does not have opIndex
merged-on-behalf-of: Steven Schveighoffer <schvei...@users.noreply.github.com>

--


[Issue 17742] std.range.transposed does not have opIndex

2017-10-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17742

--- Comment #2 from Vladimir Panteleev  ---
Ouch. I didn't realize transposed works with jagged arrays.

Considering this issue and that transposed doesn't work with static arrays
(because they're not ranges), maybe a separate function would be better, which
is closer to the matrix operation (in supporting indexing and static arrays).

--


[Issue 17742] std.range.transposed does not have opIndex

2017-10-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17742

Steven Schveighoffer  changed:

   What|Removed |Added

 CC||schvei...@yahoo.com

--- Comment #1 from Steven Schveighoffer  ---
Vladimir, would appreciate your input on the PR:
https://github.com/dlang/phobos/pull/5805

Currently, transposed uses `filter` to remove elements from the range
transposition when the underlying column has become empty.

So for instance:

assert([[1,2,3], [4,5], [6,7,8]].transposed.equal([[1,4,6], [2,5,7], [3,8]]);

Note the jaggedness of the range of ranges changes in weird ways, especially
when holes appear in the middle.

While this may be reasonable, it precludes performing opIndex on an element of
the transposed result. So while transposed can be indexed if the ranges
individually can be indexed, the resulting elements cannot be, making your code
example unimplementable.

--