GENSYMLET
(defmacro gensymlet ((&rest bindings) &body body) (let ((keys (loop for n in bindings collect (first n))) (vals (loop for n in bindings collect (second n)))) `(with-gensyms (,@keys) `(let (,,@(loop for j in keys for k in vals collect ``(,,j ,,k))) ,,@body))))

Similar to rebinding, but "splicy":

(gensymlet ((x x-expression) (y y-expression)) `(declare (fixnum ,x ,y)) `(do-fixnum-stuff ,x ,y))

The macroexpanded equivalent:

(LET ((#:X34078 X-EXPRESSION) (#:Y34079 Y-EXPRESSION)) (DECLARE (FIXNUM #:X34078 #:Y34079)) (DO-FIXNUM-STUFF #:X34078 #:Y34079))

This is mentioned on the rebinding page.


macro example