combinators: Fix definition for disjoin

main
Luis Guilherme Coelho 2024-09-01 13:48:10 -03:00
parent bfefb07673
commit 687357bb42
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
1 changed files with 3 additions and 4 deletions

View File

@ -41,10 +41,9 @@ if these arguments satisfy every other predicate in PREDICATES."
"Returns a procedure that is the disjunction of every predicate in PREDICATES. "Returns a procedure that is the disjunction of every predicate in PREDICATES.
The returned procedure takes an arbitrary number of arguments, and returns #t if The returned procedure takes an arbitrary number of arguments, and returns #t if
these arguments satisfy exactly one predicate in PREDICATES, and #f otherwise." these arguments satisfy exactly one predicate in PREDICATES, and #f otherwise."
(lambda args (match (filter (partial (flip apply) args) predicates)
(match (filter (partial (flip apply) args) predicates) ((_) #t)
((_) #t) (else #f)))
(else #f))))
(define* ((inclusive-disjoin . predicates) . args) (define* ((inclusive-disjoin . predicates) . args)
"Returns a procedure that is the inclusive disjunction of every predicate in "Returns a procedure that is the inclusive disjunction of every predicate in