But apparently, you can't curry a function using more than one (curry) argument:
Code: Select all
> (define (f x y z) (* x (+ y z)))
> (define f-2-3 (curry f 2 3))
> (f-2-3 4)
value expected in function + : z
called from user defined function f
called from user defined function f-2-3
Code: Select all
(define-macro (currie f)
(letex ($f (eval f)
$cargs (map eval (args)))
(lambda () (apply $f (append (quote $cargs) (args))))))
> (define f-2-3 (curry f 2 3))
> (f-2-3 4)
14