I am using New Jersey SML on Windows. If test.sml
is an SML file I can execute it by running this at a Windows command prompt:
C:\> sml test.sml
I then get the usual SML output and a new SML command prompt.
Standard ML of New Jersey v110.75 [built: Sat Sep 29 12:51:13 2012]
[opening hw1.sml]
val d2 = (1,1) : int * int
val d3 = (1,1) : int * int
val d4 = (2,1) : int * int
val d5 = (1,2) : int * int
val x7 = true : bool
-
What I would like instead is to be exited back to the Windows command prompt and not be left in the SML interactive mode.
How can I do this?
Did you try:
sml <test.sml
Beyond that, using its compilation manager (CM) SML/NJ actually allows you to compile a program into binaries and run them separately. The manual should be able to tell you more (see especially section 15 describing the ml-build command).
Also from the command line you can:
Ctrl - C interrupts (incase of loops that will not exit etc...)
Ctrl - Z exits the REPL
Running SML/NJ that way, it will open the REPL (read-eval-print-loop). Thus it will wait for new declarations to interpret, until you tell it to exit.
Acording to the SML/NJ faq on usage, then
The OS.Process.exit function is the proper means of quiting sml from within a program.
It takes either OS.Process.success
or OS.Process.failure
as argument.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With