Allow conjoin and disjoin to be used with unregistered predicates.
authorChris Hanson <org/chris-hanson/cph>
Sun, 12 Feb 2017 05:31:04 +0000 (21:31 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sun, 12 Feb 2017 05:31:04 +0000 (21:31 -0800)
src/runtime/compound-predicate.scm

index 183f8f45f6ee29c970395f8dfb66732faff73152..aad7bd579009a18e39582f4adf4f74d7ad2dd34f 100644 (file)
@@ -134,11 +134,13 @@ USA.
                  (list car-predicate cdr-predicate)))
 
 (define (make-predicate datum-test operator operands)
-  (tag->predicate
-   ((compound-operator-builder operator)
-    datum-test
-    operator
-    (map predicate->tag operands))))
+  (if (every predicate? operands)
+      (tag->predicate
+       ((compound-operator-builder operator)
+       datum-test
+       operator
+       (map predicate->tag operands)))
+      datum-test))
 \f
 (define compound-operator?)
 (define compound-operator-builder)