basis library ?bug?

Stephen Weeks MLton@sourcelight.com
Fri, 6 Jul 2001 09:23:46 -0700


> YIKES: there is what I would call a bug in the MLton basis library.  In C, if
> you `exit' (not _exit, but exit), then all output bufferes are flushed.  This
> is NOT being done in MLton.
> 
> Note,  again  in  C,  it  is  important to have both exit and _exit.  Is this
> fixable?

I don't see the same bug as you.  Perhaps it is just confusion.  In SML,
OS.Process.exit flushes, while Posix.Process.exit does not.  To distinguish,
try the following two programs.

val _ = (TextIO.output (TextIO.stdOut, "hello\n")
	 ; OS.Process.exit OS.Process.success)


val _ = (TextIO.output (TextIO.stdOut, "hello\n")
	 ; Posix.Process.exit 0w0)