std.path review: update

Steven Schveighoffer schveiguy at yahoo.com
Mon Jul 18 10:16:29 PDT 2011


On Sun, 17 Jul 2011 17:27:41 -0400, Lars T. Kyllingstad  
<public at kyllingen.nospamnet> wrote:

> Based on your comments, I have made some changes to my std.path
> proposal.  A list of the changes I have made can be found at the
> following address (look at the commits dated 2011-07-17):
>
>   https://github.com/kyllingstad/phobos/commits/std-path

This is a review of the docs/design.  I'll review the code separately:

basename's standards section says:

(with suitable adaptions for Windows paths)

adaptions => adaptations

This occurs twice.

In driveName:

Should std.path handle uunc paths?  i.e. \\servername\share\path  (I think  
if it does, it should specify \\servername\share as the drive)

joinPath:

Does this normalize the paths?  For example:

joinPath("/home/steves", "../lars") => /home/steves/../lars or /home/lars ?

If so, the docs should reflect that.  If not, maybe it should :)  If it  
doesn't, at least the docs should state that it doesn't.

pathSplitter:

I think this should be a bi-directional range (no technical limitation I  
can think of).

fcmp:
"On Windows, fcmp is an alias for std.string.icmp, which yields a case  
insensitive comparison. On POSIX, it is an alias for std.algorithm.cmp,  
i.e. a case sensitive comparison."

What about comparing c:/foo with c:\foo?  This isn't going to be equal  
with icmp.

expandTilde:

I've commented on expandTilde from the other posts, but if it is kept a  
posix-only function, the documentation should reflect that.


More information about the Digitalmars-d mailing list