Tools for Functional Design and Programming (E2004)
We recommend using the editor XEmacs and the Standard ML system Moscow ML for the course. This page contains a brief guide to setting up and using these tools on ITU, as well as links for getting the software for your private computer.
Setting up XEmacs and Moscow ML at ITU
XEmacs is installed and available. To enable SML-features, you have to modify one of XEmacs' configuration file. Do the following:
- Start XEmacs.
- Select the menu item Options, then Save Options to Init File.
(You do this exclusively to make XEmacs create a .xemacs
directory.)
-
Copy this file to C:\Documents and Settings\<your account name>\.xemacs\init.el. If the latter already exists, copy-paste the content of the former into it.
That's it!
Using XEmacs and Moscow ML
Quick start from within XEmacs, editing an SML-file:
- C-c C-s to start the ML interpreter
- Correct the path to U:\debois\mosml\run-mosml.bat.
- Go to the top of the buffer with your SML-file and type C-c C-b
to load the file into the interpreter.
Very brief tutorial:
- Open a file (say firstcode.sml). Note that XEmacs goes into
SML mode: The status line will say SML, and an SML-item will appear in the menubar - most of XEmacs SML features can be accessed from here.
- Write some SML code in your file (for example, the fact function).
- Press C-c C-s to start the toplevel (that is, press
Control and hold it down while you press c and then
(still holding Control down) s).
-
XEmacs should now ask you: ML command: U:\debois\mosml\run-mosml.bat (see the bottom of the
XEmacs window) to acknowledge this just press Enter.
If XEmacs suggests some other path, enter the above path.
If XEmacs gets the ml commands wrong, copy-paste the above.
Voila, you should now have a split screen with the toplevel at the buttom.
- To send you SML code to the toplevel. First, bring your cursor back to the
top part of the XEmacs window. Then, press C-c C-b.
- The short-cut for switching between the top and the buttom part of the
XEmacs window is C-x o (that is, press Control and hold
it down while you press x then let go of Control and
press o).
IMPORTANT NOTE! Always exit the SML-interpreter by writing quit(); before exiting XEmacs - otherwise, the mosml seemingly survives and eventually hogs all your systems memory.
Tutorials for XEmacs
XEmacs comes with a tutorial
that can be accessed from the Help menu.
XEmacs and Moscow ML at home
Linux users: Most major distributions have both XEmacs and Moscow ML available as packages.
Windows users: Follow the links below.
Author: Søren Debois (debois (at) itu.dk)