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
1

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

> pi
3.141592653589793
but
> 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
> e
2.718281828459045
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