Running Common Lisp On Solaris Unix

The interpreter is called lisp and it is located in /opt/franz-5.0.1/acl501 on the open-lab machines. You can add that to your path file by modifying your .cshrc file to contain the following command at the end

module load franz/5.0.1

You must source your .cshrc file for this change to take effect.

source .cshrc

Note next time you log in, it will be in your path automatically because .cshrc is read each time you start up a command shell (and that happens when you log in).

You can run the interpreter with the following command:

lisp

You will see the following prompt:

Allegro CL Enterprise Edition 5.0.1 [SPARC] (6/29/99 16:47)
Copyright (C) 1985-1999, Franz Inc., Berkeley, CA, USA. All Rights Reserved.
;; Optimization settings: safety 1, space 1, speed 1, debug 2.
;; For a complete description of all compiler switches given the
;; current optimization settings evaluate (EXPLAIN-COMPILER-SETTINGS).
USER(1): 

The USER(1): is the command prompt. You may enter any expression and the interpreter will read it, evalate what it read, then print the result.

The lisp top level loops over the following expression:

(print (eval (read)))

You can load a file of lisp definitions with the following command:

(load "file.l")

Where file.l is the name of your file located in the current working directory. You should give lisp files the extension .l. Note the double quotes are required.

Or you can load a file of lisp definitions with the following command:

:ld file.l

When you make an error, the interpreter will take you into a debug level. It may look something like this:

Restart actions (select using :continue):
0: retry the load of foo.l
1: skip loading foo.l
2: retry the load of foo.l
3: skip loading foo.l
4: Abort #
[2] USER(5):

This can be quite painful at first. The [2] tells you you are 2 levels deep in the debugging package. In this example, you can use the command

:continue 1

to "skip loading the file foo.l". You can give other integers to select the other options from their option menu. The most painful thing about this break package is, the command numbers change each time, so you must look at the list and select the right number.

You can leave the lisp interpreter by giving the following command

(exit)

Or, you may exit with the command

:exit

You can trace the evaluation of your functions by the following command

(trace function-name)

You can turn off tracing with the following command

(untrace function-name)

You can get pathetic on-line help with the following command:

:help

You can get a list of your previous commands with the following command

:history

If you run into a run-time error, you can get a list of the stack frames (so you can see how you got to the error) with the command

:top

If you get a run-away interpreter (e.g., via an infinite loop), you can interrupt it with a single ^C (control C). Then you select this option:

2: Return to Top Level (an "abort" restart)

Avoid using ^Z to stop your program. This only suspends the interpreter and these suspended processes can accumulate. You can find out what processes you have suspended or running in the background with the following command (note the first % is the Unix command prompt):

% jobs

Here is the sample output if I have one lisp interpreter suspended

[1] + Suspended lisp

You can kill (terminate) any job with the command:

% kill %jobID

where jobID is the number of the job listed in the jobs command. For example, you can kill the lisp job above with the command

% kill %1

If you get into a state where you can't get out of the interpreter (perhaps by typing too many ^C characters), you can leave by typing ^\ (control backslash) which causes any Unix process to quit. If you leave via this method, you should remove the very large core file it dumps. You can do this with the rm command:

% rm core