Handy SML/NJ how-tos
Run SML/NJ from the command prompt
This is, again, linked off the web page, but you should edit
the file named .cshrc in your home directory (using Emacs,
of course) so that it contains the following line:
set path = (/cse/courses/misc_lang/linux/sml/bin/ $path)
Then, log out, log back in, and type sml at the command
prompt. SML will come up in your xterm.
Load a file into SML/NJ
Type use "myfile.sml" within SML/NJ to load an existing
file. Retyping long definitions is annoying, so this is highly
recommended. But, it would be even nicer to...
Run SML/NJ within Emacs
There are two ways to do this:
- Type M-x shell in Emacs; this brings up a
*shell* buffer. Then, type sml. SML/NJ should
start up in this buffer, and you can interact with it just as if
you were in a console window.
- The other way is to open a SML file (like first.sml from the
previous page), and then hit C-c C-l. If your sml-mode
is properly configured, you will be prompted for the SML
executable and the file to load, and a buffer labeled
*sml* should pop up with the current file loaded:
Keunwoo Lee
Last modified: Wed Mar 28 22:00:21 PST 2001