[MLton] Windows ports and paths

Stephen Weeks MLton@mlton.org
Mon, 2 May 2005 15:23:15 -0700


> > What you wrote doesn't work for dir="C:" and file=""... 
> > InvalidArc is raised.
> 
> Not when I run it.  I get "C:/".

Not the brightest thing I've ever said :-(.
How about the following?

fun joinDirFile {dir, file} =
   let
      val {arcs, isAbs, vol} = fromString dir
      val arcs = 
	 case (arcs, file) of
	    ([], "") => []
	  | _ => concatArcs (arcs, [file])
   in
      toString {arcs = arcs,
		isAbs = isAbs,
		vol = vol}
   end