Plaster
New
List
Login
common-lisp
default
anonymous
2021.02.17 16:57:37
(defmacro with-new-tempo ((tempo-val) &body body) (alexandria:with-gensyms (temp) `(let ((,temp *tempo*)) (unwind-protect (progn (setf *tempo* ,tempo-val) (locally ,@body)) (setf *tempo* ,temp))))) (let ((*tempo* 500)) (print *tempo*) (with-new-tempo (300) (print *tempo*)) (print *tempo*)) > 500 > 300 > 500
Raw
Annotate
Repaste
Edit