Plaster
New
List
Login
common-lisp
default
anonymous
2022.01.31 17:18:36
(defmacro static-let ((name init) &body body) (let ((x (gensym))) `(progn (unless (boundp ',x) (setf (symbol-value ',x) ,init)) (symbol-macrolet ((,name (symbol-value ',x))) ,@body)))) (defun bar () (static-let (x 0) (incf x)))
Raw
Annotate
Repaste
Edit