Moscow ML Owner’s Manual

Moscow ML implements Standard ML (SML), as defined in the 1997 Definition of Standard ML, including the SML Modules language and some extensions. Moreover, Moscow ML supports most required parts of the SML Basis Library. It supports separate compilation and the generation of stand-alone executables. This document explains how to use the Moscow ML system. A companion document, the Moscow ML Language Overview, summarizes Moscow ML syntax and the most common built-in functions [9]. Another companion document, the Moscow ML Library Documentation, describes in detail all Moscow ML library modules [10].

Get a copy of the Moscow ML system executables (see Section 20 for instructions) and unpack them in your home directory (under Unix) or in directory C:\ (under MS Windows and DOS). This creates a directory mosml. Read the file mosml/install.txt. This manual, as well as the Moscow ML Language Overview and the Moscow ML Library Documentation, are in directory mosml/doc.

The interactive system is invoked by typing mosml at the shell prompt. It allows you to enter declarations and evaluate expressions:
$ mosml
Moscow ML version 2.00 (June 2000)
Enter ‘quit();’ to quit.
- fun fac n = if n = 0 then 1 else n * fac (n-1);
> val fac = fn : int -> int
- fac 10;
> val it = 3628800 : int
You can quit the interactive session by typing ‘quit();’ or control-D (under Unix) or control-Z followed by new-line (under MS Windows and DOS). Type help “lib”; for an overview of built-in function libraries, and e.g. help “Array” for help on Array operations. See Section 3 for further information on mosml.

Get pdf Moscow ML Owner’s Manual

Comments

Leave a Reply