X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fdefconstant.lisp;h=db7d6286a2e7c769a1fe88d821cea1d979f356ad;hb=2378406d6eda78090dfe05e372438495aeace5e0;hp=5f155ebd06642c9be36401a860d11084d8aacbb2;hpb=45bc305be4e269d2e1a477c8e0ae9a64df1ccd1c;p=sbcl.git diff --git a/src/compiler/defconstant.lisp b/src/compiler/defconstant.lisp index 5f155eb..db7d628 100644 --- a/src/compiler/defconstant.lisp +++ b/src/compiler/defconstant.lisp @@ -24,9 +24,9 @@ (unless (symbolp name) (error "The constant name is not a symbol: ~S" name)) (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)) + (style-warn 'sb!kernel:asterisks-around-constant-variable-name + :format-control "defining ~S as a constant" + :format-arguments (list name))) (sb!c:with-source-location (source-location) (setf (info :source-location :constant name) source-location)) (let ((kind (info :variable :kind name))) @@ -43,7 +43,7 @@ the usual naming convention (names like *FOO*) for special variables" (if (boundp name) (if (typep name '(or boolean keyword)) ;; Non-continuable error. - (about-to-modify-symbol-value name "define ~S as a constant") + (about-to-modify-symbol-value name 'defconstant) (let ((old (symbol-value name))) (unless (eql value old) (multiple-value-bind (ignore aborted) @@ -57,7 +57,7 @@ the usual naming convention (names like *FOO*) for special variables" (when aborted (return-from sb!c::%defconstant name)))))) (warn "redefining a MAKUNBOUND constant: ~S" name))) - (:global + (:unknown ;; (This is OK -- undefined variables are of this kind. So we ;; don't warn or error or anything, just fall through.) ) @@ -99,6 +99,10 @@ the usual naming convention (names like *FOO*) for special variables" ;; doubt such warnings are ANSI-compliant, but I'm not sure, so I've ;; written this in a way that CMU CL will tolerate and which ought to ;; work elsewhere too.) -- WHN 2001-03-24 - (eval `(defconstant ,name ',value)))) + (eval `(defconstant ,name ',value))) + ;; It would certainly be awesome if this was only needed for symbols + ;; in CL. Unfortunately, that is not the case. Maybe some are moved + ;; back in CL later on? + (setf (info :variable :xc-constant-value name) value)) (setf (info :variable :kind name) :constant) name)