Of course you want to enjoy features like command line history, parenthesis matching and navigating through an expression with the arrow keys. Suppose you work on a Linux machine, you have two possibilities to get all these things. First you can install rlwrap. If you then invoke the interpreter with rlwrap ./cubint ...
, the tool will catch all your input and you can replay it with the arrow keys. The second possibility is to use the editor emacs
with sml-mode. If you set up emacs for SML, follow these steps:
- Load a file and switch to the SML mode (
M-x sml-mode
).
- Press CTRL-C + CTRL-B. Now you (hopefully) see an input prompt like "ML command: " in the mini-buffer.
- Input here the location of the compiled interpreter and press ENTER.
- Answer "Any Args: " with any of the arguments listed in section 2 and press ENTER.
- Now the content of the buffer is passed to the interpreter and you can go on working with it in the usual sml-mode fashion.
This approach also work with Emacs on Windows. Alternatively you can use the Windows XP shell that offers a command line history which also works in the interpreter. To input more complicated expressions use an arbitrary text editor and load the file with use "file"
(cf. section 4).
Christian Müller
2004-11-09