repl-usage.md 1.5 KB

Starting the REPL

sml

Show sml command help

sml -h

Inside REPL

Loading a program

Corresponding to (load "file.scm") in Scheme:

use "filename";

Opening a library

Opening a library will introduce its bindings into the current environment:

open "filename";
(* or *)
open structure_name;

Directories

Current directory

OS.FileSys.getDir();

Change directory

OS.FileSys.chDir("filename");

Use compilation manager

CM.make "file.cm";

Find more info at https://www.smlnj.org/doc/CM/index.html.

Exiting the REPL

Either use C-d or run the following code:

OS.Process.exit(OS.Process.success);

More info

Some links: