Skip to content
Snippets Groups Projects
Commit 1e923770 authored by Attila Lendvai's avatar Attila Lendvai
Browse files

Added compiler macro for RCURRY.

Patch by Bike from #lisp, http://paste.lisp.org/display/338772
parent 16fabb10
No related branches found
No related tags found
No related merge requests found
......@@ -142,6 +142,16 @@ with and ARGUMENTS to FUNCTION."
(declare (dynamic-extent more))
(multiple-value-call fn (values-list more) (values-list arguments)))))
(define-compiler-macro rcurry (function &rest arguments)
(let ((rcurries (make-gensym-list (length arguments) "RCURRY"))
(fun (gensym "FUN")))
`(let ((,fun (ensure-function ,function))
,@(mapcar #'list rcurries arguments))
(declare (optimize (speed 3) (safety 1)))
(lambda (&rest more)
(declare (dynamic-extent more))
(multiple-value-call ,fun (values-list more) ,@rcurries)))))
(declaim (notinline curry rcurry))
(defmacro named-lambda (name lambda-list &body body)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment