(defun flatten (thing) (if (atom thing) (list thing) (reduce #'append (mapcar #'flatten thing) :from-end t)))