$K#+Getting Started
When you start CML it loads up its main data file and then becomes quiescent. The (red) "-" is the prompt, and indicates that CML is waiting for your input.
Evaluating expressions
Try typing "2+2" and pressing return. CML replies with another prompt (a red "="); it has remembered the previous line but is still expecting some more text. The end of sentence marker in ML is a semicolon (like a fullstop in English). Typing ";" and pressing return completes the input and CML replies with "4 : int". 4 is the value of the result and int is its type, i.e., the type of integer values. CML always tells you the type of any value it displays. Try typing in a few arithmetic expressions (using +,-,* and div) to see what response you get (don't forget the semicolons).
Declaring Values
Each time you type in an expression at the prompt, CML evaluates it, displays the result and assigns the result to the special variable it. Just typing it; and pressing return should redisplay the value of the last expression you entered.
You can assign a value to a name using the val construct. For instance, typing this into CML:
val foo = 400 div 2 + 17 - 33;
gives the reply:
val foo = 184 : int
The value 184 has now been bound to the name foo and can be used in any expressions from this point onward, foo-30; for instance. Looked at the other way round foo has been declared (defined) to be the value 184.
The val binding for foo above is only the simplest form of binding allowed in CML.
Should really finish this section!

$K#+Simple editing and file use
For your first few sessions with CML it will make sense to type in all of your programs each time you want to try them. However after a while you will want to save programs as files and edit existing ones to correct the mistakes in them or to extend their capabilities.
One reasonable way to do all this is to use the NOTEPAD application that Windows stores in its "Accessories" folder.  Locate the accessories folder and if it is shown in your "program manager" group as just a little icon, double-click on it to see the items available in it, then double-click on "Notepad" to start that up.  You should see an area into which you can type text, with File, Edit, Search and Help menus available.
If you type a program into the notepad you can use the FILE menu to store your code away.  For ML programs please use a name that ends in ".ml", for instance "mycode.ml". The notepad allows you to re-position the caret and insert, delete or change characters. It is not a very elaborate editor. The HELP menu from the Notepad gives full information on what it can do.
If use the Select All command from the Notepad EDIT menu then all your text should go to inverse vidoe, indicating that it has been "selected". Then EDIT-Copy grabs a copy of the selected text into a (usually invisible) place known as the clipboard.  If you now click somewhere in your CML window (its title bar should then change colour to show you that it has become active) and select EDIT-Paste the text from the notepad is fed to CML just as if you had typed it in.  This is a big extra effort if you only type things in once, but can be a big help later on since it makes it easy to use Notepad to correct the text of your program and then you cxan go Copy-Paste again to get the corrected version into CML.
To "select" something less than the whole contents of the notapad, point the cursor at the first character you want, press (and hold down) the left mouse button and move the mouse to the last character you want before releasing the button.
You can select and copy text from the CML window and paste it into the notepad one it that is useful.

$K#+Installing CML on your own computer
Doing this is only for people with enough experience to cope with the inevitable curiosities that may arise. For the Windows version of this package you should have a 386 or 486 machine with Windows 3.1 and at least 4 Mbytes of memory. You will need a few megabytes free on your hard disc.
The first thing to do is to check that you have a good and up-to-date virus control package on your computer, and that you understand how to use it. Do not assume that just because a disc is supposed to contain software related to a course that that guarantees that the disc is safe. It is your responsibility to ensure that your system is kept secure, and any time you install fresh software on it you should act with caution.
Before attempting to install CML itself you need to make sure that a package called Win32s is installed on your machine. This is a set of extensions to Windows 3.1 (or Windows fopr Workgroup 3.11) that make support of large applications much easier. The easiest check is tyhat is Win32s is installed you will probably have game called "freespace" present. If not, you need to borrow a Win32s installation disc, use the file manager to run the "setup" program on it, and follow Microsoft's instructions.
With Win32s installed, you just need copies of three files, cml.exe, cml.hlp and cml.exp, into some directory on your hard disc. Open some folder (eg APPLICATIONS). You then need to find the FILE menu from the "program manager" and use the "New" command from it.  You want a new program item, and when invited to fill in the details you can press the "browse" buttom and then find the file cml.exe that you just installed. Select that, and give it as its description something like "ML for Windows". There is no need to fill in a working directory or a shortcut key. If all goes well you should then see the CML icon in your applications directory ready for use.
If ANYTHING goes wrong with CML on anything other than one of the laboratory-supported computers you are on your own: we can not guarantee to reproduce or correct problems that arise in such cases. But a first thing to try if something unexpected happens is to verify that the same bad behaviour is seen on one of the central machines. Despite the fact that problems on students own machines will not be investigated or fixed at all fast, we would like to know what problems have been encountered so that the version issued next year can be better behaved.
ML can be compiled for and will run on a large range of machines other than DOS or Windows ones, but during the initial course that uses it the Computer Laboratory only intends to support one version of the software. Check again later on in the year if you have real enthusiasm for making a version that works on something else, and expect it to be a somewhat fiddly process.  The lab maintains versions on ML running on various of the Unix workstations that is uses.  But note again that the Windows version is the one intended for and supported for direct use in the course.

$K#+Credits
The ML execution engine here was developed at the University of Edinburgh, with major contributions from Alan Mycroft and others. Sam Nelson from Stirling made further improvements. Arthur Norman re-instated support for big-number arithmetic and is responsible for the Windows interface code. Much of this help text was written by G Procida and D R Jones.

This version of ML is provided under the terms of the attached licence from the University of Edinburgh.  A version is available for raw MSDOS and another for Microsoft Windows.  If you collect a copy of these files on floppy disc it is your responsibility to install the system on your computer, and you will need a amall amount of experience to do so:
Windows:
Ensure that "win32s" is installed on your Windows machine.  This is a Microsoft extension to regular Windows 3.1 that allows some 32-bit applications to run.  If it is installed you probably have a game called "freecell" available (which is installed as a test of win32s). If not, install win32s before doing anything else.
Put the files cml.exe, cml.exp and cml.hlp all in the same directory on your hard disc.
Create a new program group if you want.  Create a program item in this group, and make it refer to the file cml.exe.
That should be all!  Run CML by double-clicking on the ML icon. Leave it by selecting EXIT from the FILE menu.
MSDOS:
Ensure that your machine is an 80386 or 80486 or Pentium computer with at least 4 Mbytes of memory.
Copy the file cmldos.exe from the distribution disc, but call it just cml.exe on your hard disc.  Copy the file cml.exp to the same directory on your hard disc.
check the "path" statement in your "autoexec.bat" file and either ensure that you put the cml files in one of the directories listed there, or edit "autoexec.bat" to add the name of the new directory you used for cml.
If you altered autoexec.bat, re-start your computer so that the new settings come into force.
Start ML by typing "cml".  Leave it by typing control-Z.
                                A C Norman.   August 1994
There may be some sample ML programs on this disc with name thatend ".ml".  To try them under Windows select READ from the FILE menu andthen locate the file.  Type ENTER after ML has displayed a linethet starts off "use". Under DOS go
    use "filename.ml";
where "filename.ml" is the name of the file to be processed.
Laboratory for Foundations of Computer Science
----------------------------------------------
Department of Computer Science - University of Edinburgh
Standard ML Licence Agreement
-----------------------------
Return one copy of this document to LFCS Software Distribution at the
address below and keep one copy for your records.

LFCS,                                              031-667-1081 ext. 2987
Department of Computer Science,                  Telex: 727442 (UNIVED G)
University of Edinburgh,                          E-Mail:ml@uk.ac.ed.lfcs
King's Buildings,
Edinburgh, EH9 3JZ
UK

I, the licensee, agree to the conditions below in respect of the Standard ML
System supplied by the Laboratory for Foundations of Computer Science of the
University of Edinburgh.

Signed: 	____________________________   Date:________________________

Name(printed):	____________________________________________________________

Title:	        ____________________________________________________________

Organisation:	____________________________________________________________

Address:	____________________________________________________________

                ____________________________________________________________

Telephone:	__________________ Electronic Mail: ________________________

Conditions of Licence:

1. Title to and copyright of the Standard ML System remains with the Laboratory
for Foundations of Computer Science at the University of Edinburgh.

2. The ML System may be used freely within the licensee's organisation for
research and educational purposes. Commercial and revenue earning use are
excluded form this agreement. Evaluation for potential commercial use is
permitted, but licencees are advised to contact LFCS in advance of this
activity.

3. The licensee will not pass the ML System to anyone outside their
organisation unless they are already signatories to this licence in which case
the system may be copied to them under the same terms as this licence. No
charge may be levied for this distribution.

4. The licensee accepts the ML system "as is". The University of Edinburgh
makes no warranty in respect of the ML System. Nevertheless licensees are
encouraged to report to LFCS any problems with or suggestions for improvement
of the the ML System.

5. The licensee may modify the supplied ML System on condition that any
significant changes are notified to LFCS and made available to LFCS such that
they may be incorporated within future releases of the ML System and licenced
under the conditions of this licence agreement.  "Significant changes" will
include, for example, changes to the language accepted by the system or ports
to previously unsupported host computer types. Licencees are strongly advised
to consult LFCS before starting such work in order to avoid duplication and to
assess the feasibility of the work.

6. Licencees will acknowledge LFCS and The University of Edinburgh as the
designers of the ML language and implementors of this implementation in any
relevant document or publication.