diff options
-rw-r--r-- | def.lisp | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -18,13 +18,14 @@ easily document uninitialized special variables." "Define a constant in a way that is redefinable whenever the form is reevaluated." (assert (good-muffed-var-name-p name :muffer "+")) - `(progn - (handler-bind ((error - (lambda (&rest ignore) - (declare (ignore ignore)) - (invoke-restart 'cl:continue)))) - (makunbound ',name)) - (defconstant ,name ,value ,@(when doc (list doc))))) + (let ((newval (gensym "NEWVAL-"))) + `(let ((,newval ,value)) + (handler-bind ((error + (lambda (&rest ignore) + (declare (ignore ignore)) + (invoke-restart 'cl:continue)))) + (makunbound ',name)) + (defconstant ,name ,newval ,@(when doc (list doc)))))) (defmacro class (name (&rest supers) &body slots-and-options) "Define a class. |