[Issue 12404] New: Zip.back is wrong

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 18 07:31:35 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12404

           Summary: Zip.back is wrong
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2014-03-18 07:31:34 PDT ---
Because it processes the back of each range, rather than an index. EG:

//----
import std.range, std.stdio;

void main()
{
    auto a = [1];
    auto b = [1, 2];
    auto c = [1, 2, 3];
    zip(a, b, c).back.writeln();
}
//----

This writes "Tuple!(int, int, int)(1, 2, 3)".

For "shortest", it should print "1, 1, 1".
For "longest", it should print "0, 0, 3".

For "same length", it's an error.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list