X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fdefconstant.lisp;h=403db52fc6aaa7c99064b386f6ee5c2af375d28c;hb=40e3ba03d0e1b824e4d1ae75d74246b975b70964;hp=c70e9271e10bc6994a480b685836fc7569082fb9;hpb=d49c71bf00d858efc5796900ca4954fb76ce6402;p=sbcl.git diff --git a/src/compiler/defconstant.lisp b/src/compiler/defconstant.lisp index c70e927..403db52 100644 --- a/src/compiler/defconstant.lisp +++ b/src/compiler/defconstant.lisp @@ -26,7 +26,7 @@ (when (looks-like-name-of-special-var-p name) (style-warn "defining ~S as a constant, even though the name follows~@ the usual naming convention (names like *FOO*) for special variables" - name)) + name)) (let ((kind (info :variable :kind name))) (case kind (:constant @@ -39,17 +39,17 @@ the usual naming convention (names like *FOO*) for special variables" ;; something like the DEFCONSTANT-EQX macro used in SBCL (which ;; is occasionally more appropriate). -- WHN 2001-12-21 (unless (eql value - (info :variable :constant-value name)) - (multiple-value-bind (ignore aborted) - (with-simple-restart (abort "Keep the old value.") - (cerror "Go ahead and change the value." - 'defconstant-uneql - :name name - :old-value (info :variable :constant-value name) - :new-value value)) - (declare (ignore ignore)) - (when aborted - (return-from sb!c::%defconstant name))))) + (info :variable :constant-value name)) + (multiple-value-bind (ignore aborted) + (with-simple-restart (abort "Keep the old value.") + (cerror "Go ahead and change the value." + 'defconstant-uneql + :name name + :old-value (info :variable :constant-value name) + :new-value value)) + (declare (ignore ignore)) + (when aborted + (return-from sb!c::%defconstant name))))) (:global ;; (This is OK -- undefined variables are of this kind. So we ;; don't warn or error or anything, just fall through.) @@ -75,14 +75,14 @@ the usual naming convention (names like *FOO*) for special variables" ;; CL:FOO. It would be good to unscrew the ;; cross-compilation package hacks so that that ;; translation doesn't happen. Perhaps: - ;; * Replace SB-XC with SB-CL. SB-CL exports all the + ;; * Replace SB-XC with SB-CL. SB-CL exports all the ;; symbols which ANSI requires to be exported from CL. ;; * Make a nickname SB!CL which behaves like SB!XC. ;; * Go through the loaded-on-the-host code making ;; every target definition be in SB-CL. E.g. ;; DEFMACRO-MUNDANELY DEFCONSTANT becomes ;; DEFMACRO-MUNDANELY SB!CL:DEFCONSTANT. - ;; * Make IN-TARGET-COMPILATION-MODE do + ;; * Make IN-TARGET-COMPILATION-MODE do ;; UNUSE-PACKAGE CL and USE-PACKAGE SB-CL in each ;; of the target packages (then undo it on exit). ;; * Make the cross-compiler's implementation of @@ -110,5 +110,5 @@ the usual naming convention (names like *FOO*) for special variables" (eval `(defconstant ,name ',value)))) (setf (info :variable :kind name) :constant - (info :variable :constant-value name) value) + (info :variable :constant-value name) value) name)