combinators: Correct procedure definitions
parent
1d0ecb3955
commit
a365ad9734
|
@ -66,14 +66,14 @@ obtained by appending ARGS to MORE-ARGS."
|
||||||
"Returns a procedure that applies PROC to the reverse of ARGS."
|
"Returns a procedure that applies PROC to the reverse of ARGS."
|
||||||
(lambda args (apply proc (reverse 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
|
"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
|
applies PROC to the list obtained by cons*ing ARG2 ARG1 to ARG2 to the list
|
||||||
of aditional arguments."
|
of aditional arguments."
|
||||||
(lambda (arg1 arg2 . args)
|
(lambda (arg1 arg2 . args)
|
||||||
(apply proc arg2 arg1 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.
|
"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
|
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)."
|
containing the result of applying each procedure to the args (left-to-right)."
|
||||||
|
|
Loading…
Reference in New Issue