Variable Values in Lisp

We can think of a symbol as a data structure that includes a value cell containing a pointer to the value of the atom. The value of the symbol can be set using the function SET:


(SET 'PRESIDENT 'JEFFERSON)
If we now evaluate PRESIDENT, we get the value JEFFERSON.

Since the first argument of SET is usually quoted, there is a special function SETQ that does this automatically.


(SETQ PRESIDENT 'JEFFERSON)


(SETQ RADIUS 5.0)

(* PI (EXPT RADIUS 2))

Contents    Page-10    Prev    Next    Page+10    Index