From a365ad9734fc5c8a3f7de60a8cc988474ec9d05c Mon Sep 17 00:00:00 2001 From: Luis Guilherme Coelho Date: Wed, 3 Jan 2024 00:43:04 -0300 Subject: [PATCH] combinators: Correct procedure definitions --- modules/radix/combinators.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/radix/combinators.scm b/modules/radix/combinators.scm index 21e6084..650e608 100644 --- a/modules/radix/combinators.scm +++ b/modules/radix/combinators.scm @@ -66,14 +66,14 @@ obtained by appending ARGS to MORE-ARGS." "Returns a procedure that applies PROC to the reverse of ARGS." (lambda args (apply proc (reverse args)))) -(define ((swap proc) arg1 arg2 . more-args) +(define (swap proc) "Returns a procedure that takes ARG1, ARG2 and optionally more args, and applies PROC to the list obtained by cons*ing ARG2 ARG1 to ARG2 to the list of aditional arguments." (lambda (arg1 arg2 . args) (apply proc arg2 arg1 args))) -(define ((juxt proc . more-procs) . args) +(define (juxt proc . more-procs) "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)."