[phobos] std.path proof of concept

Andrei Alexandrescu andrei at erdani.com
Mon Apr 26 12:31:41 PDT 2010


On 04/26/2010 01:10 PM, Ellery Newcomer wrote:
> Andrei Alexandrescu<andrei at ...>  writes:
>
>>
>> I looked at the design. It is very solid and elegant, but I suggest we
>> save it for a different opportunity. Scenarios in which code running on
>> a platform yet needs extensive functionality for the other are a tad
>> tenuous.
>>
>
> Part of the point of the path manipulation routines in dmdz.d was to get around
> the fact that dmd/windows doesn't have posix path manipulation. Another part was
> to convert from one to the other. I don't think such scenarios are tenuous at
> all. As far as abstractions are concerned, though, no idea.

I see. But since zip files work on both Windows and Unix, there must be 
a common ground of functionality that works for both. I'm hoping to 
insist on that instead of enacting a schism. After the schism, widening 
the incompatibilities will become the path of least resistance.

> ps Lars, what do you think of my path2list (splits a path into an array [range?]
> of the path elements) and its inverse? It looks like it could be implemented
> very cleanly in your rewrite.

I suggest we go with lazy ranges throughout. No memory allocation unless 
the user asks for it by calling std.array.array(range).  For example, 
splitter() vs. split() was a huge accelerator in virtually all my text 
processing programs.


Andrei


More information about the phobos mailing list