Plaster
New
List
Login
common-lisp
default
anonymous
2022.11.10 05:08:23
(defmacro partial-application (&body body) "A partial application of parameters macro. Works as follows: (partial-application f x y _ z _ w _ _) expands to #'(lambda (a b c d) (f x y a z b w c d)) where a, b, c, d are actually GENSYM parameters." (let* ((variable-count (count '_ body)) (variables (loop repeat variable-count collect (gensym)))) `#'(lambda ,variables (,@(loop for x in body if (eq '_ x) collect (pop variables) else collect x)))))
Raw
Annotate
Repaste
Edit