Here it is:  Interactive LML!

The system is quite unstable, but may be useful anyway.  I would like you
to report any problems you encounter.


How to install
--------------

	- Unpack your tar file in /usr/local/lib/lmlc (or whereever you
	  have installed your files).
	- Move lmli to a binary directory.
	- Put the lml-mode.el in a suitable place so that GNU Emacs can
	  find it.


How to use
----------
Start the system with 'lmli'.  It will then announce itself and prompt
you for input with '> '.  The possible commands are:

    <expression>;
	Evaluate and print the expression (more on printing below).

    let <declarator>;
	Make the bindings in <declarator> and make them available in
	the rest of the session.  No evaluation of the bound objects
	is performed.

    load <string>;
	Load a file.  The string specifies what should be loaded, it can have
	three forms:
	- *.m	load a .m file.  This must be an ordinary LML module.
	- *.o	load .o and .t files.  These files must be produced
		by compiling an ordinary LML module with lmlc.
	- *	loads *.m if it is newer than *.o, otherwise the *.o file.

    source <string>;
	Read commands from the given file.

    quit;
	Quit the system.

Any calls to fail in the expressions you evaluate will (should?) be caught
and reported.  It is possible to interrupt the evaluation with ^C, but this
seems to sometimes leave the system in an unstable state.  The system
does not catch ^\ nor ^Z, so it's possible to use them to quit.

If the program does not stop after the first ^C, then try another.
The first only interrupts the program at certain well defined places
and is less dangerous.  The second stops the program anywhere but in
garbage collection.

** BUG WARNING: Sometimes a ^C will terminate lmli instead of being caught! **


Printing
--------
The system attempts to pretty print the result of the evaluation, it knows how
to print the pre-defined types.  For a non-pre-defined type, T, it checks if
there is a function show_T.  If there is this function is used to print it
otherwise it uses a default routine thst just prints the type enclosed in 
"<<>>".  If the type is a type constructor (as List) the show_T function should
be a curried function with as many extra arguments as there are type variables
in the type.
A result of the type 'List Char' is always printed as itself.


Problems
--------
Lots!!, E.g.
    - Interactive programs cannot be written (i.e. you cannot read from the
      terminal).


GNU Emacs LML mode
------------------
The file lml-mode.el is a major mode for GNU Emacs for editing LML
programs and running the interactive system.  It is a hacked up version
of the SML mode written by Lars Bo Nielsen.  The interactive system becomes
much more useful once you use this.

It's still pretty buggy.


Implementation information
--------------------------
The system uses the first half of the LML compiler and then translates the
expressions via combinators.  Almost all of it written in LML, except for
magic functions like load that loads object files.

	-- Lennart Augustsson
	augustss@cs.chalmers.se

