Plaster

common-lisp
(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)))