Plaster
New
List
Login
common-lisp
default
anonymous
2022.01.31 19:35:17
(defmacro static-let ((name init &optional (type t)) &body body) (let ((x (gensym))) `(locally (declare (special ,x)) (unless (boundp ',x) (setf ,x ,init)) (symbol-macrolet ((,name (the ,type ,x))) ,@body)))) (defun bar () (declare (optimize (speed 3))) (static-let (x 0 fixnum) (incf x)))
Raw
Annotate
Repaste
Edit