From dda033a2d91f536011c99d024a4815d7d5c37639 Mon Sep 17 00:00:00 2001 From: Luis Guilherme Coelho Date: Mon, 26 Aug 2024 18:43:44 -0300 Subject: [PATCH] combinators: Fix proc signatures --- radix/combinators.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/radix/combinators.scm b/radix/combinators.scm index 7079def..3012d0a 100644 --- a/radix/combinators.scm +++ b/radix/combinators.scm @@ -27,7 +27,7 @@ LST satisfies PRED." (cond ((pred head) #t) (else (loop tail))))))) -(define* ((conjoin . predicates) args) +(define* ((conjoin . predicates) . args) "Returns a procedure that is the conjuction of every predicate in PREDICATES. The returned procedure takes an arbitrary number of arguments, and returns #t if these arguments satisfy every other predicate in PREDICATES." @@ -37,7 +37,7 @@ if these arguments satisfy every other predicate in PREDICATES." ((apply head-pred args) (loop tail-preds)) (else #f))))) -(define* ((disjoin . predicates) args) +(define* ((disjoin . predicates) . args) "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 these arguments satisfy exactly one predicate in PREDICATES, and #f otherwise." @@ -46,7 +46,7 @@ The returned procedure takes an arbitrary number of arguments, and returns #t if ((_) #t) (else #f)))) -(define* ((inclusive-disjoin . predicates) args) +(define* ((inclusive-disjoin . predicates) . args) "Returns a procedure that is the inclusive disjunction of every predicate in PREDICATES. The returned procedure takes an arbitrary number of arguments, and returns #t if these arguments satifsy at least one predicate in PREDICATES, and @@ -57,12 +57,12 @@ returns #t if these arguments satifsy at least one predicate in PREDICATES, and ((not (apply head-pred args)) (loop tail-preds)) (else #f))))) -(define* ((partial proc . args) more-args) +(define* ((partial proc . args) . more-args) "Returns a procedure that receives MORE-ARGS applies PROC to the list obtained by appending ARGS to MORE-ARGS." (apply proc (append args more-args))) -(define* ((flip proc) args) +(define* ((flip proc) . args) "Returns a procedure that applies PROC to the reverse of ARGS." (apply proc (reverse args))) @@ -72,7 +72,7 @@ applies PROC to the list obtained by cons*ing ARG2 ARG1 to ARG2 to the list of aditional arguments." (apply proc arg2 arg1 args)) -(define* ((juxt proc . more-procs) args) +(define* ((juxt proc . more-procs) . args) "Returns a procedure that is the juxtaposition of it's argument procedures. The returned procedure takes a variable number of args, and returns a list containing the result of applying each procedure to the args (left-to-right)."