X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fmacros.lisp;h=559889eb78b974863c266a780097b92effa42286;hb=bee53328c93be3433477821131ab805557476c8b;hp=2bf63a644c772ac68a31dab77d2cc4b0af9b2de1;hpb=2c6b90e36a7c0377cd79625eb6c94d580f98cb93;p=sbcl.git diff --git a/src/code/macros.lisp b/src/code/macros.lisp index 2bf63a6..559889e 100644 --- a/src/code/macros.lisp +++ b/src/code/macros.lisp @@ -80,11 +80,10 @@ (defmacro-mundanely defconstant (name value &optional documentation) #!+sb-doc - "For defining global constants. DEFCONSTANT says that the value is - constant and may be compiled into code. If the variable already has - a value, and this is not EQL to the init, the code is not portable - (undefined behavior). The third argument is an optional documentation - string for the variable." + "Define a global constant, saying that the value is constant and may be + compiled into code. If the variable already has a value, and this is not + EQL to the new value, the code is not portable (undefined behavior). The + third argument is an optional documentation string for the variable." `(eval-when (:compile-toplevel :load-toplevel :execute) (sb!c::%defconstant ',name ,value ',documentation))) @@ -93,6 +92,10 @@ (unless (symbolp name) (error "The constant name is not a symbol: ~S" name)) (about-to-modify 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)) (let ((kind (info :variable :kind name))) (case kind (:constant @@ -200,12 +203,6 @@ ,body)))) `(sb!c::%define-compiler-macro ',name #',def ',lambda-list ,doc))))) (defun sb!c::%define-compiler-macro (name definition lambda-list doc) - ;; FIXME: Why does this have to be an interpreted function? Shouldn't - ;; it get compiled? - (aver (sb!eval:interpreted-function-p definition)) - (setf (sb!eval:interpreted-function-name definition) - (format nil "DEFINE-COMPILER-MACRO ~S" name)) - (setf (sb!eval:interpreted-function-arglist definition) lambda-list) (sb!c::%%define-compiler-macro name definition doc)) (defun sb!c::%%define-compiler-macro (name definition doc) (setf (sb!xc:compiler-macro-function name) definition)