SML/NJ has been installed on some of the college machines. If you find a machine that doesn't have it, that you wish did, please email the TA.
All SML/NJ files are located in underneath
/usr/local/public/packages/sml-nj. Here
are the relevant lines that need to be added to .bashrc
(or the equivalent):
# SML setup SMLROOT=/usr/local/public/packages/sml-nj export SMLROOT PATH=$PATH:$SMLROOT/bin
Then, simply type "sml-cm" to start the interperter
There is an sml-mode for Emacs which is very handy; it does syntax highlighting and auto-indenting, and when you are running SML, it lets you press alt-P to retrieve previously typed (or mistyped) commands. If you don't know Emacs already, this is a good excuse to learn it.
To set up sml-mode, add the following lines to your .emacs file:
;; SML mode
(add-to-list 'load-path "/usr/local/public/share/emacs/site-lisp/sml-mode")
(autoload 'sml-mode "sml-mode" "Major mode for editing SML." t)
(setq sml-program-name "sml-cm")
(autoload 'run-sml "sml-proc" "Run an inferior SML process." t)
(add-to-list 'auto-mode-alist '("\\.\\(sml\\|sig\\)\\'" . sml-mode))
If you get an error when loading sml-mode into emacs, you may be using an incompatible version of emacs. Try using the one in /usr/local/public/bin, which is newer.