summaryrefslogtreecommitdiff
path: root/def.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'def.lisp')
-rw-r--r--def.lisp15
1 files changed, 8 insertions, 7 deletions
diff --git a/def.lisp b/def.lisp
index c4ab58b..715ab7f 100644
--- a/def.lisp
+++ b/def.lisp
@@ -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.