Quotation

A symbol in Lisp can have a value, also called its binding. There must be a way to distinguish the symbol itself from its value. In English these are not formally distinguished.

The President is the chief executive.

The President has a wife named Laura.

In Lisp, we denote the symbol itself by quoting it with a single-quote symbol.


(GET 'PRESIDENT 'DUTIES)

(GET PRESIDENT 'SPOUSE)

Internally, the ' symbol becomes the pseudo-function QUOTE:


(GET (QUOTE PRESIDENT) (QUOTE DUTIES))
Quoting a list makes a constant data structure:

(SETQ FORMULA '(= AREA (* PI (EXPT R 2))))

Contents    Page-10    Prev    Next    Page+10    Index