Search found 1 match

by thebhgg
Fri Nov 19, 2010 1:36 pm
Forum: Common Lisp
Topic: How deep is a list?
Replies: 4
Views: 9328

Re: How deep is a list?

(defun depth (tree) (if (atom tree) 0 (1+ (apply #'max (mapcar #'depth tree))))) I think I need to learn how to do this more simply, but I took the above advice from Ramarren, except I didn't seem to need REDUCE. As a base case, I know the depth of an atom (which I checked, includes nil, the empty ...