HOW TO INVOKE THE SCM INTERPRETER ON MATHLAN

The Scheme implementation that we'll be using during class sessions is called SCM and was written by Aubrey Jaffer (jaffer@ai.mit.edu).

On MathLAN, it's usual to run SCM in the hpterm terminal emulator. Click on the icon of a monitor-and-keyboard on the bottom row of the HP VUE front panel to create an hpterm window. To run SCM in interactive mode, move the mouse pointer into the window and type scm -p1 at the prompt. (The -p1 option suppresses a running commentary that SCM otherwise provides, telling you how much time and memory it uses to perform each of the operations.) SCM will signal that it is ready to begin processing Scheme definitions and expressions by printing its own prompt, which is a greater-than sign followed by a space. At this point, the contents of the window will look something like this:

bourbaki% scm -p1
> 
You type in a definition or an expression after the prompt. You may use more that one line if necessary; SCM will not react until you have typed a complete Scheme definition or expression, no matter how many lines it requires. At the end of the definition or expression, press the Return key to terminate the line. SCM will then display the value of the expression (or the symbol #<unspecified> in the case of a definition or an expression that is evaluated for its side effect) and print its prompt again, thus:

bourbaki% scm -p1
> (+ 28 39)
67
>
To exit from SCM, press Control/D at the prompt. A second Control/D will close the window.

To run SCM in batch mode, add the name of the file containing your Scheme program to the command line, followed finally by the option -b. (It is important that the -b be placed at the end.)

bourbaki% scm -p1 foo.scm -b
bourbaki%
In batch mode, neither prompts nor the results of evaluating expressions are printed; any output that is to appear must be generated by the Scheme program itself, using such output procedures as display and newline.


created June 5, 1996
last revised June 6, 1996

John David Stone (stone@math.grin.edu)