First of all, you would like to correct these warnings, and not just ignore them. Everything else is just an ugly habit!
print "Hello World!\n"; val _ = OS.Process.exit(OS.Process.success);
Also, as far as I know: there is no way to get rid of message autoload in sml / nj. You could try another translator. Poly / ml does not say much, however I cannot find a way to run it in a file. Mosmin also talks a little, and here you can run it in a file (even the .mlb file, as far as I was told - it is undocumented).
Another way would be to compile your files, but then the goal of scripting will disappear.
You messed up one of the cases when sml is not a suitable tool for work.
Update
I found out that you can actually get some of the ways by setting verbose to off in the compilation manager controller:
;#set CM.Control.verbose false;
This eliminates the majority, however it still prints messages with automatic loading, as they have to load the CM.Control structure. And it only closes later. However, the documentation also states that you can set the CM_VERBOSE environment variable
CM_VERBOSE=false sml foo.sml
which makes him almost silent. Using this source
val _ = print "Hello World!\n"; val _ = OS.Process.exit(OS.Process.success);
generates the following output:
$ CM_VERBOSE=false sml foo.sml Standard ML of New Jersey v110.72 built: Wed May 12 15:29:00 2010] [opening foo.sml] Hello World!
Pay attention to val _ = ... so that it does not write val it = () : unit every time.
Jesper.Reenberg
source share