CASE-MATCH

where x is a variable symbol, the pati are structural patterns
as described below, the dcli are optional declare forms and
the bodyi are terms. Return the value(s) of the bodyi
corresponding to the first pati matching x, or nil if none
matches.

Pattern Language:
With the few special exceptions described below, matching requires
that the cons structure of x be isomorphic to that of the
pattern, down to the atoms in the pattern. Non-symbol atoms in the
pattern match only themselves. Symbols in the pattern denote
variables which match anything and which are bound by a successful
match to the corresponding substructure of x. Variables that
occur more than once must match the same (EQUAL) structure in
every occurrence.

Exceptions:
& Matches anything and is not bound. Repeated
occurrences of & in a pattern may match different
structures.
nil, t, *sym* These symbols cannot be bound and match only their
global values.
!sym where sym is a symbol that is already bound in the
context of the case-match, matches only the
current binding of sym.
'obj Matches only itself.

Some examples are shown below.

Below we show some sample patterns and examples of things they match
and do not match.

Consider the two binary trees that contain three leaves. They might
be described as (x . (y . z)) and ((x . y) . z), where x,
y, and z are atomic. Suppose we wished to recognize those
trees. The following case-match would do:

Suppose we wished to recognize such trees where all three tips are
identical. Suppose further we wish to return the tip if the tree is
one of those recognized ones and to return the number 7 otherwise.