Standard ML is a safe, modular, strict, functional, polymorphic programming language with compile-time type checking and type inference, garbage collection, exception handling, immutable data types and updatable references, abstract data types, and parametric modules. It has efficient implementations and a formal definition with a proof of soundness. For more information:
/home/user/yourname/yourdir/
init.el
file;; SML Mode ;; ============================ (setq load-path (cons "/home/user/yourname/yourdir" load-path)) (autoload 'sml-mode "sml-mode" "Major mode for editing SML." t) (setq sml-mode-info "~/yourdir/sml-mode/sml-mode.info") (setq auto-mode-alist (append '(("\\.cm$" . sml-mode) ("\\.fun$" . sml-mode) ("\\.sml$" . sml-mode) ("\\.sig$" . sml-mode) ("\\.ML$" . sml-mode)) auto-mode-alist)) (add-hook 'sml-load-hook '(lambda () (require 'sml-font))) (defun delete-gc-message () (beginning-of-line 0) (if (looking-at ".*\\(GC #[0-9]+[\.[0-9]+]*: *([0-9]* ms)\C-m*\n\\)") (delete-region (match-beginning 1) (match-end 1)))) (defun comint-filter-sml-gc-messages (foo) (save-excursion (goto-char comint-last-output-start) (delete-gc-message))) (add-hook 'inferior-sml-mode-hook (lambda () (add-to-list 'comint-output-filter-functions 'comint-filter-sml-gc-messages)))
M-sml
. This will start a "sml" process in the background. *sml*
. Now you can start programming within emacs or xemacs.
SML has been installed on some of the lab machines (lab7-1 to lab7-16) and you should be able to start the SML compiler by logging into one of these machines and then typing sml in a shell.
To run the code provided, you should first change to the directory where your sml code resides. Then you can start the sml compiler by typing sml. To compile the code provided, just type CM.make "sources.cm";
If you have started the sml compiler in a different directory than your code, you must change to correct directory. Within sml you can type the following:
Posix.FileSys.chdir "dirname";
change directory to dirnamePosix.FileSys.getcwd();
get the name of the current directory