On Friday, 7 June 2013 at 17:27:16 UTC, Andrei Alexandrescu wrote:
On 6/7/13 1:04 PM, monarch_dodra wrote:
I think using string as the main form of representation for a
path is fine.
However, there are times where it is convenient to be able to
explode a
path into a structure, where each part is clearly separate
from the
next.
Tuple!(
string, "drive",
string[], "folders",
string, "basename",
string, "extension"
)
parsePath(string path);
string buildPath(string drive, string[] folders, string
basename, string extension);
Andrei
Yeah. That's pretty much more or less what I was describing.
Except "buildPath" would take your (unnamed) tuple type directly.
There'd be also be a "filename" member/ufcs function in there for
convenience.
I think that would be a small, but useful, addition to std.path.