Name: Anonymous 2007-06-20 0:11 ID:OhxqYAeK
(defmacro p/ (f &rest body)
(let ((args (gensym)))
`(lambda (&rest ,args)
(apply #',f (append ',body ,args)))))
usage:
(mapcar (p/ + 1) '(1 2 3)) --> (2 3 4)
alternate syntax, with the help of a few read macros
(mapcar #[+ 1] '(1 2 3))
(let ((args (gensym)))
`(lambda (&rest ,args)
(apply #',f (append ',body ,args)))))
usage:
(mapcar (p/ + 1) '(1 2 3)) --> (2 3 4)
alternate syntax, with the help of a few read macros
(mapcar #[+ 1] '(1 2 3))