(defmacro save-variables (syms &body body) (let* ((l (length syms)) (gs (loop :repeat l :collect (gensym))) (saves (loop :for g :in gs :for s :in syms :collect `(,g ,s))) (restores (loop :for g :in gs :for s :in syms :collect `(setf ,s ,g)))) `(let ,saves ,@body ,@restores)))