next up previous
Next: 1.2 Elementary Functions Up: 1. THE LISP LANGUAGE Previous: 1. THE LISP LANGUAGE

1.1 Symbolic Expressions

The most elementary type of S-expression is the atomic symbol.

Definition: An atomic symbol is a string of no more than thirty numerals and capital letters, the first character must be a letter.

Examples

        A 
        APPLE 
        PART2 
        EXTRALONGSTRINGOFLETTERS 
        A4B66XYZ2

These symbols are called atomic because they are taken as a whole and are not capable of being split within LISP into individual characters. Thus A, B, and AB have no relation to each other except in so far as they are three distinct atomic symbols.

All S-expressions are built out of atomic symbols and the punctuation marks "(", ")", and ".". The basic operation for forming S-expressions is to combine two of them to produce a larger one From the two atomic symbols Al and A2, one can form the S-expression (Al . A2).

Definition: An S-expression is either an atomic symbol or it is composed of these elements in the following order, a left parenthesis, an S-expression, a dot, an S-expression, and a right parenthesis.

Notice that this definition is recursive.

Examples

        ATOM 
        (A . B) 
        (A . (B . C)) 
        ((Al . A2) . B) 
        ((U . V) . (X . Y)) 
        ((U . V) . (X . (Y . Z)))


next up previous
Next: 1.2 Elementary Functions Up: 1. THE LISP LANGUAGE Previous: 1. THE LISP LANGUAGE