next up previous
Contents Next: Atoms Up: LISt Processing Previous: Background and Getting

Basic Data Types

The two most important kinds of objects in LISP for you to know about are atoms and lists. These two kinds are mutually exclusive, with the exception of one special entity, the empty list, known as ``()'' or ``nil,'' which is both an atom and a list.

Atoms are represented as sequences of characters of reasonable length.

Lists are recursively constructed from atoms. This means that a given list may contain either atoms or other lists as members.

Examples:

 
ATOMS 			 LISTS

a ()

john (a)

34 (a john 34 c3po)

c3po ((john 34) a ((c3po)))

Atoms and lists are both legal LISP expressions for the interpreter to read and evaluate. The rules for evaluating atoms and lists in LISP are very simple (one of the great beauties of the language). They are covered in the next two sections.





© Colin Allen & Maneesh Dhagat
November 1999