(defun Show (rules &optional (level 1)) (if (null rules) "" (format nil "~A. If ~A Then~%~Aclass = ~A~%~A~A" level (RDRule-comment rules) (indent level) (RDRule-class rules) ;(xindex-ns (RDRule-good rules)) ;(xindex-ns (RDRule-bad rules)) ;(xindex-ns (RDRule-ugly rules)) (if (not (null (RDRule-true rules))) (format nil "~ATrue ~A~%" (indent level) (Show (RDRule-true rules) (+ 1 level))) "") (if (not (null (RDRule-false rules))) (format nil "~AFalse ~A" (indent (- level 1)) (Show (RDRule-false rules) (+ 0 level))) "")))) (deftest test-Show () (check (samep (Show (make-RDRule :fn (MakePredicate 1 'ADULT) :class 'YES :comment (list 0 1 'ADULT))) "If (0 1 ADULT) Then class = YES")))