r8183: docbook functions
[kmrcl.git] / lists.lisp
index 35e74ba3482236cf8dd4f01cfc6948de66e273bd..336baa02864fd29363c82ef90949aed6e6cfddae 100644 (file)
     (unless (find elem l1)
       (setq l1 (append l1 (list elem))))))
 
-(defun remove-from-tree-if (pred tree)
+(defun remove-from-tree-if (pred tree atom-processor)
   "Strip from tree of atoms that satistify predicate"
   (if (atom tree)
       (unless (funcall pred tree)
-       tree)
-    (let ((car-strip (remove-from-tree-if pred (car tree)))
-         (cdr-strip (remove-from-tree-if pred (cdr tree))))
+       (if atom-processor
+           (funcall atom-processor tree)
+         tree))
+    (let ((car-strip (remove-from-tree-if pred (car tree) atom-processor))
+         (cdr-strip (remove-from-tree-if pred (cdr tree) atom-processor)))
       (cond
        ((and car-strip (atom (cadr tree)) (null cdr-strip))
        (list car-strip))