[MLton] Windows ports and paths

Stephen Weeks MLton@mlton.org
Mon, 2 May 2005 13:19:27 -0700


Here's my take on what needs to be fixed.

* concat ("foo", "") should be "foo", not "foo/".  This can be fixed
  by replacing the special-case code in the definition of concat

    (if List.null a2 then [""] else a2)

  with simply "a2".

* joinDirFile should not trim the slash from the directory.  So, it
  should look something like 

    fun endsInSlash s = slash sub 0 = String.sub (s, size s - 1)

    fun joinDirFile {dir, file} =
       if not (isArc file) then raise InvalidArc
       else if 0 = size dir then file
       else if endsInSlash dir then String.concat [dir, file]
       else String.concat [dir, slash, file]

I've committed these changes.