A Customization of SML/NJ


Summary

smlcus is a customized version of Standard ML of New Jersey (SML/NJ). It can be installed on PCs running Linux, Mac OS X or Windows.

Features

smlcus begins by loading (using use — see below) the file named by the user's SMLRC environment variable, if this variable is set, and if its contents is an absolute (fully qualified) file. It then tries to load each of its command line arguments, if any. To exit from smlcus, type CTRL-d, under Linux/Mac OS X, and CTRL-z, under Windows. To interrupt the evaluation of an expression, type CTRL-c.

By default, smlcus will only print the first

By default, garbage collection messages are not printed. To arrange for these messages to be printed, evaluate the expression SMLofNJ.Internals.GC.messages true.

The following functions are defined by smlcus:

  getDir        : unit   -> string
  setDir        : string -> unit

  use           : string      -> unit
  getSearchPath : unit        -> string list
  setSearchPath : string list -> unit

  debugInt      : string * int    -> int
  debugBool     : string * bool   -> bool
  debugChar     : string * char   -> bool
  debugString   : string * string -> string

  debug         : ('a -> string) -> string * 'a -> 'a

getDir and setDir get and set the current directory.

use f loads the file f, i.e., causes the contents of f to be compiled. If f doesn't exist in the current directory, then use looks for f in the directories in the current search path (see below). If f is "" (the null string), then use reloads the most recently loaded file.

getSearchPath() returns the current value of the search path (initially the path is nil). setSearchPath ds checks that each of the elements of ds is an absolute (fully qualified) directory, and then sets the current search path to ds.

debugInt(msg, n) prints the message msg and the integer n on the standard output, and then pauses, after printing the message

  (press RETURN to continue or CTRL-c to interrupt)

If the user responds to this message by typing RETURN, then debugInt will return the integer n. The functions debugBool, debugChar and debugString work similarly.

debug h yields the function of type string * 'a -> 'a that, when called with (msg, x), prints msg and the string h x on the standard output, and then pauses, after printing the message

  (press RETURN to continue or CTRL-c to interrupt)

If the user responds to this message by typing RETURN, then the function will return x.

Installing smlcus on a PC running Linux or Mac OS X

If you want to install smlcus on your Linux or Mac OS X system, carry out the following instructions, running as root.

Installing smlcus on a PC running Windows

If you want to install smlcus on your Windows system, carry out the following instructions.


Alley Stoughton (Alley.Stoughton@gmail.com)