Next: , Previous: , Up: Getting Started   [Index]


1.2 The LISP Interpreter

LISP is normally used as an interpreter. You type in arguments and an operation to perform on them. The “calculator” does the operation and prints out an answer. To begin a session with the LISP calculator, you first need to start up a LISP process. This is generally done by issuig the command to your operating system to run LISP. LISP will identify itself and signal that it is ready to accept an input.

Generic Common LISP
->

The arrow is LISP’s signal that it is waiting for an input.

Now we are ready to ask the LISP calculator to perform an operation. First, begin the command with a parenthesis. Next, specify the name of an operation to perform. Then give the arguments to use. Finish the whole thing off with a final parenthesis. If we want to computer “8 + 3” using our LISP calculator, type the following:

-> (+ 8 3)
11
->

+’ is the name for the addition operator; ‘8’ and ‘3’ are the arguments to this operator.

S-EXPRESSIONS

LISP programmers call commands like these s-expressions, which stands for symbolic expressions. This is a very general term, applicable to just about anything one can say in LISP.This terminology is used because LISP is normally used for things other than numeric computation. The basic form of all symbolic expressions will be similar. This is most of the syntax of LISP.