Summary: Splitter should be bi-dir if the input range is bi-dir
           Product: D
           Version: 2.029
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos

obviously there's 'better' ways of doing this, but use it an a contrived

    string inputpath = "/a/b";

    auto parts = splitter(inputpath, "/");
    // parts is ["", "a", "b"]
    parts.popFront; // get rid of empty leading part
    auto file = parts.back;
    writefln("file = %s", file);
    auto path = reduce!(q{a ~= "/" ~ b})("", parts);
    writefln("path = %s", path);

Problem: Splitter is strictly a forward range currently.


Reply via email to