Fix Issue 6004 - std.range.unzip()#5701
Conversation
|
Thanks for your pull request, @RazvanN7! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla references
|
wilzbach
left a comment
There was a problem hiding this comment.
Thanks a lot for following up on this. I'm sadly on the road, so would you be so kind to add this as a new unittest?
std/range/package.d
Outdated
| assert(equal(ror, [ 2, 4 ][])); | ||
| assert(equal(ror, [ 2, 4 ])); | ||
|
|
||
| // full unzip |
There was a problem hiding this comment.
Could you please create a new public test for this? The comment will then be displayed as tile
std/range/package.d
Outdated
| import std.algorithm.iteration : map; | ||
| int[][] y = new int[][3]; | ||
| y[0] = [1, 2, 3]; | ||
| y[1] = [4, 5, 6]; |
There was a problem hiding this comment.
You could have created the array directly as well
|
@wilzbach Don't mention it. I addressed the comments, hope it's ok now. |
The original bug report requested the addition of the function unzip to phobos which is the opposite of zip. Fortunately, the function
transversalexists (as @wilzbach pointed out) which can be used to solve the problem elegantly. I updated the docs to mention that this feature is calledunzipin other languages and added the example posted in the bug report.