[MLton] Windows ports and paths

Andreas Rossberg AndreasRossberg@web.de
Sun, 1 May 2005 14:07:41 +0200


> > The second, slash_is_absolute.patch considers "\" to be absolute
> > and "E:\" simply the same as "\" with a volume.
>
> I've checked in this one for now.

When I added support for Windows-style volumes to the Alice lib I
interpreted the spec in the same way. Still I found the treatment of volumes
to be somewhat underspecified. For instance, what should #arcs(fromString
"A:") deliver? (I went for [""], in analogy to "/").

I also discovered at least two problems in the spec regarding case
insensitivity:

  - mkRelative should bring its path argument into canonical form as well,
    otherwise case inconsistencies are introduced

  - concat's samle implementation suggests that volumes must be equal even
    with respect to case, which is inadequate for case insensitive systems
like
    Windows (also affects mkAbsolute)

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.

I reported most of these and a quite number of other issues with OS.Path to
the basis discussion list at the time, but they never got fixed. :-(

> splitDirFile "b/" = {dir = "b", file = ""}
>
> which fits well with
>
> joinDirFile {dir = "b", file = ""} = "b/"
>
> which makes it seem that the old behavior was correct.  I'll also
> point out that every SML implementation except for Hamlet does it like
> MLton.  Based on past experience, this probably means that every
> implementation except for Hamlet is wrong :-).  Andreas, any thoughts?

Yes, Hamlet got it wrong. I already made several fixes to the OS.Path
implementation since the last release, including this one.

Cheers,

  - Andreas