[MLton] Windows ports and paths

Andreas Rossberg AndreasRossberg@web.de
Mon, 2 May 2005 23:01:48 +0200


>        else if 0 = size dir then file

Actually, this test will be wrong on Windows, where dir can be a path with
no arcs but a volume. :(

The obvious correct implementation is

        fun joinDirFile {dir, file} =
            let
                val {isAbs, vol, arcs} = fromString dir
            in
                toString {isAbs=isAbs, vol=vol, arcs=arcs@[file]}
            end

Slightly suboptimal efficiency-wise, though...