next up previous
Contents Next: Basic Data Types Up: LISt Processing Previous: LISt Processing

Background and Getting Started

LISP is an acronym for LISt Processor. It was developed by John McCarthy in the late 1950s, and his account of its history can be found at http://www-formal.stanford.edu/jmc/history/lisp/lisp.html. Lisp found many adherents in the artificial intelligence community, and it is one of the oldest computer languages still in widespread use.

There are many variants (or dialects) of Lisp including Scheme, T, etc. In the 1980s there was an attempt to standardize the language. The result is Common Lisp (see Guy L. Steele, Jr., Common Lisp: The Language, 2nd Edition, Digital Press, 1990). Common Lisp is now the most popular dialect.

If you are familiar with another programming language, such as C, Pascal, or Fortran, you will be familiar with the concept of a compiler. A compiler is a program that takes a complete program written in one of these languages and turns it into a set of binary instructions that the computer can process. All major implemenations of Lisp provide a compiler, but unlike most languages, Lisp is also often used as an interpreted language. This means that you can start an interpreter which can process and respond directly to programs written in Lisp. Interacting with an interpreter makes easy interactive prototyping and debugging of programs possible. Once compiled, Lisp programs run just as fast and efficiently as well-written code in other standardly-compiled languages.

When you start up a Lisp interpreter, a prompt will appear, something like this:

> 
The Lisp interpreter waits for you to enter a well-formed Lisp expression. Once you have entered an expression, it immediately evaluates the expression entered and returns a response. For example:

> (+ 1 2 3 4)
10
> 
In this example, the user typed the Lisp expression (+ 1 2 3 4) and the interpreter responded with 10 and a new prompt.

The interpreter runs what is known as a read-eval-print loop. That is, it reads what you type, evaluates it, and then prints the result, before providing another prompt.

In what follows, it will be assumed that you have a Lisp interpreter running in front of you. Exactly how to start Lisp up will depend on the computer system you are using. If you need to, check the instructions for your Lisp interpreter or ask a local person to find out how to get started. You will also need to know how to get out of the Lisp interpreter. This too varies, even between implementations of Common Lisp, but (quit), (exit), and (bye) are some common alternatives.

Do not go any further until you know how to start up and exit Lisp on your system.



next up previous
Contents Next: Basic Data Types Up: LISt Processing Previous: LISt Processing



© Colin Allen & Maneesh Dhagat
March 2007