
ANSI Common Lisp 14 Conses 14.2 Dictionary of Conses
14.2.13 treeequal 
Function 
 Syntax:

treeequal
tree1 tree2 &key test testnot
generalizedboolean
 Arguments and Values:

tree1  a tree.
tree2  a tree.
test  a designator for a function of two arguments
that returns a generalized boolean.
testnot  a designator for
a function of two arguments
that returns a generalized boolean.
generalizedboolean  a generalized boolean.
 Description:

treeequal tests whether two trees are of the same shape
and have the same leaves.
treeequal returns true if tree1 and tree2 are
both atoms and satisfy the test,
or if they are both conses and
the car of tree1 is treeequal to
the car of tree2 and
the cdr of tree1 is treeequal to
the cdr of tree2.
Otherwise, treeequal returns false.
treeequal recursively compares conses but not any
other objects that have components.
The first argument to the :test or :testnot
function is tree1 or a car or cdr of tree1;
the second argument is tree2 or a car
or cdr of tree2.
 Examples:

(setq tree1 '(1 (1 2))
tree2 '(1 (1 2))) (1 (1 2))
(treeequal tree1 tree2) true
(eql tree1 tree2) false
(setq tree1 '('a ('b 'c))
tree2 '('a ('b 'c))) ('a ('b 'c))
((QUOTE A) ((QUOTE B) (QUOTE C)))
(treeequal tree1 tree2 :test 'eq) true
 Exceptional Situations:

The consequences are undefined
if both tree1 and tree2 are circular.
 See Also:

equal,
Section 3.6 Traversal Rules and Side Effects
 Notes:

The :testnot parameter is deprecated.
 Allegro CL Implementation Details:

None.
