Path as an object in std.path

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jun 6 10:46:58 PDT 2013


On 6/6/13 1:04 PM, Lars T. Kyllingstad wrote:
> On Thursday, 6 June 2013 at 16:03:15 UTC, Andrei Alexandrescu wrote:
>> [...]
>>
>>> 8. There really isn't any such thing as a portable path representation.
>>> It's more than just \ vs /. There are the drive prefixes in Windows that
>>> have no analog in Linux. Sometimes case matters in Linux, where it would
>>> be ignored under Windows. There are 8.3 issues sometimes. The only thing
>>> you can do is come up with a subset of what works across systems, and
>>> then of course you have to go back to using strings when you need to
>>> access D:\foo\abc.c
>>
>> That is actually an argument in favor of good encapsulation, not against.
>
> The proposed API change does not introduce good encapsulation. It
> introduces a super-thin wrapper around a built-in type, and replaces
> free functions with methods, for what gain?

I was talking in principle. I agree that the argument "it was as easy as 
wrapping the already existing functions" works against the current 
proposal, not in favor of it.

Andrei


More information about the Digitalmars-d mailing list