Professional Documents
Culture Documents
Lisp Code
Since the first argument of SET is usually quoted, there is a special function SETQ that
does this automatically.
REVERSE makes a new list that is the reverse of the top level of the list given as its
argument.
LENGTH returns the length of the top level of the list given as its argument.
(LENGTH '(A)) = 1
(LENGTH '(A B)) = 2
(LENGTH '((A B))) = 1
Constructing List Structure
The basic function that constructs new list structure is the function CONS.
If Y is a list, then we can think of (CONS X Y) as adding the new element X to the front
of the list Y.