digitalmars.D - std.algorithm.map + std.algorithm.joiner = broken forward range
- H. S. Teoh (20/20) Oct 09 2012 Code:
- jerro (2/19) Oct 09 2012 It happens without map too.
- H. S. Teoh (7/35) Oct 09 2012 You're right, it's a joiner bug, nothing to do with map. Filed new
Code: import std.algorithm; import std.range; import std.stdio; void main() { auto x = [[1],[2],[3]]; auto yy = x.map!"a".joiner; assert(isForwardRange!(typeof(yy))); writeln(yy.save); writeln(yy); } Output: [] [1, 2, 3] :-( That is to say, yy.save didn't save the range at all! T -- "The number you have dialed is imaginary. Please rotate your phone 90 degrees and try again."
Oct 09 2012
On Wednesday, 10 October 2012 at 02:11:49 UTC, H. S. Teoh wrote:Code: import std.algorithm; import std.range; import std.stdio; void main() { auto x = [[1],[2],[3]]; auto yy = x.map!"a".joiner; assert(isForwardRange!(typeof(yy))); writeln(yy.save); writeln(yy); } Output: [] [1, 2, 3] :-( That is to say, yy.save didn't save the range at all! TIt happens without map too.
Oct 09 2012
On Wed, Oct 10, 2012 at 05:00:00AM +0200, jerro wrote:On Wednesday, 10 October 2012 at 02:11:49 UTC, H. S. Teoh wrote:You're right, it's a joiner bug, nothing to do with map. Filed new issue: http://d.puremagic.com/issues/show_bug.cgi?id=8792 T -- "Uhh, I'm still not here." -- KD, while "away" on ICQ.Code: import std.algorithm; import std.range; import std.stdio; void main() { auto x = [[1],[2],[3]]; auto yy = x.map!"a".joiner; assert(isForwardRange!(typeof(yy))); writeln(yy.save); writeln(yy); } Output: [] [1, 2, 3] :-( That is to say, yy.save didn't save the range at all! TIt happens without map too.
Oct 09 2012