[MLton] Main.main idiom

Matthew Fluet fluet@cs.cornell.edu
Wed, 8 Sep 2004 13:54:14 -0400 (EDT)


> > You are right that part of the issue is coming from SMLofNJ.  If we
> > took his original source file:
> ...
> > then it would have worked just fine in MLton without any additional
> > work.
>
> Right.  This is annoying.

Yes and no.  It is annoying when you want the executable at the end of the
day, but I think it is better programming practice to not scatter
top-level effects around.  It can actually be useful to compile and run
the program without the call to Main.main -- it verifies that there
weren't any unexpected evaluations in the program.