2 (in-package :lambdamundo
)
4 (defmacro with-gensyms
((&rest names
) &body body
)
5 `(let ,(loop for n in names collect
`(,n
(gensym)))
8 (defmacro once-only
((&rest names
) &body body
)
9 (let ((gensyms (loop for n in names collect
(gensym))))
10 `(let (,@(loop for g in gensyms collect
`(,g
(gensym))))
11 `(let (,,@(loop for g in gensyms for n in names collect
``(,,g
,,n
)))
12 ,(let (,@(loop for n in names for g in gensyms collect
`(,n
,g
)))
15 (defmacro when-funcall
(x &rest parameters
)
16 "If the first argument is not NIL, assume it's a function and call
17 it with the supplied parameters."
21 (funcall ,fun
,@parameters
)))))