[MLton] Windows ports and paths
Wesley W. Terpstra
wesley@terpstra.ca
Sun, 1 May 2005 14:27:42 +0200
On Sun, May 01, 2005 at 02:07:41PM +0200, Andreas Rossberg wrote:
> Still I found the treatment of volumes to be somewhat underspecified.
Yeah...
> For instance, what should #arcs(fromString "A:") deliver? (I went for
> [""], in analogy to "/").
That was a mistake I think.
"A:" = "A:.", that's what MLton does now, so arcs=[] and isAbs=false.
I also think this is what the standard intended.
If you allow "\" to be absolute, then it stands to reason "" is "." and by
analogy "E:\" is absolute and "E:" is "E:."
You can confirm that Windows agrees with this as well, because "dir C:"
shows the current volume directory, not the root.
> - mkRelative should bring its path argument into canonical form as well,
> otherwise case inconsistencies are introduced
That's a good point; I didn't think of that.
Stephan, could you patch that?
- case (fromString p1, fromString (mkCanonical p2)) of
+ case (fromString (mkCanonical p1), fromString (mkCanonical p2)) of
> - concat's samle implementation suggests that volumes must be equal even
> with respect to case, which is inadequate for case insensitive systems
MLton also ignores the volume case in comparison; I agree with you.
I made that change without even realizing I had done it. :-)
> Windows (also affects mkAbsolute)
also mkRelative.
Anyways, MLton is consistent on these points.
> Without refining these points, the functions are practically useless on
> Windows (e.g. not even mkRelative("\A\B", "\A") will work). Anecdotical
> evidence is that we got all kinds of unexpected Path exceptions in the Alice
> system at first.
MLton will agree with you on all points but "A:" being root.
--
Wesley W. Terpstra <wesley@terpstra.ca>