[MLton] cvs commit: OS.Path.joinDirFile does not check argument

Matthew Fluet fluet@cs.cornell.edu
Thu, 3 Feb 2005 20:00:42 -0500 (EST)


> After the fix, MLton behaves differently than all other
> implementations on
> 
>     OS.Path.joinDirFile {dir = "", file = ""}
> 
> MLton raises InvalidArc, while other implementations return "".
> MLton's behavior seems correct, since the spec says
>
>     joinDirFile {dir, file}
>        ... If the string file does not correspond to an arc, raises
>        InvalidArc.    

I disagree; the empty arc is an arc and "" is the string representation of
the empty arc.  Hence,
  OS.Path.joinDirFile {dir = "", file =""}
is perfectly fine.  Look at the specification of splitDirFile; I would 
expect splitDirFile and joinDirFile to be inverses.

>     a non-empty string a corresponds to valid representation of an arc
>     only if fromString a returns {isAbs=false, vol="", arcs=[a]}. 
> 
> All the implementations agree that fromString "" does indeed return 
> {isAbs=false, vol="", arcs=[a]}.

I presume you mean      arcs=[]  ?