Case macro for pseudo-term objects.
This macro can be used to conveniently branch on the kind of a pseudo-term
and access its fields. It supports the five basic kinds of pseudo-term and
their fields as well as the extra pseudo-kinds
(pseudo-term-case x :const (list 'quote x.val) :var (list 'quote (cdr (assoc x.name a))) :call (list x.fn (eval-list x.args a))) (pseudo-term-case x :null (list 'null) :quote (list 'quote x.val) :var (list 'var x.name) :lambda (list 'lambda x.fn x.formals x.body x.args) :fncall (list 'fncall x.fn x.args)) (pseudo-term-case x :var nil :call (ground-term-listp x.args) :otherwise t)