[   ^ to index...   |   <-- previous   ]

Handy SML/NJ how-tos, ct'd

Save an SML/NJ transcript

Often, you will want to save output of an entire SML/NJ session. How can you do this? Here's a few alternatives:

Method 1: Saving within Emacs

If you use the method described above for running SML/NJ under Emacs, you can save the *sml* buffer the same way you save any other buffer: switch to the buffer's window and hit C-x C-s. You will be prompted for a filename. You can save as many times as you wish.

Method 2: Copy and paste

In the X Window System, the idiom for "copy and paste" is to select a region, and then click the middle mouse button (the mouse wheel on an MS mouse suffices) at the spot you want to paste the selected region:

[GNU Emacs in sml-mode with a child SML process]

Method 3: Pipes

This method is only suitable if you want to run a single file through SML/NJ and capture the results, without actually interacting manually with SML/NJ. Invoke SML/NJ as follows:

sml < myinputfile.sml > myoutputfile.txt

The < sign means "redirect standard input from this file", and the > sign means "redirect standard output to this file". Pipes are a very important and powerful feature of Unix. Learn to use them!


Keunwoo Lee
Last modified: Wed Mar 28 22:12:31 PST 2001