> What tools do we have for measuring the size of
> an expression? I know about conssize (defined
> in compar.lisp), but conssize doesn't work on cre
> expressions.
Conssize uses null rather than atom to detect end-of-list, presumably
for efficiency. Here is a slightly less efficient but cleaner and
correct version:
(defun conssize (x)
(do ((sz 0 (+ 1 (conssize (car x)) sz))
(x x (cdr x)))
((atom x) sz)))
This counts the number of conses in any expression without common
subexpressions (or circularity). Of course, that is not an accurate
measure of complexity, but maybe good enough for your application.