The Lisp Interpreter

next up previous
Next: Lisp Comments Up: A Few Simple Previous: A Few Simple

The Lisp Interpreter

The Lisp interpreter uses > for a prompt. If you type something and press the enter key (what we old fogeys call a carriage return), the interpreter evaluates whatever you typed. Numbers evaluate to themselves:

> 1

Symbols evaluate to whatever value is associated with the symbol, thus

> pi
> z
Error: The variable Z is unbound
since, in this example, the symbol has not been defined. To define a symbol, we could do something like this, where we define e to be
> (def e (exp 1))
> e
The first ``E'' is echoed by the interpreter, which is case-insensitive. At the next prompt, we typed the symbol, and the interpreter responded by printing its value.

Tue Aug 29 09:10:30 MDT 1995