[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Follow-up and New Questions



Given a piece of code like

          (defconstant const ...)

          (defun foo ()
            (let ((const 1))
              ...))


I am not saying that the compiler would not object.  I am saying that
WHEN it objected, the message MUST NOT be

          Warning: Binding a LEXICAL variable with the same name as
          a constant.

it SHOULD be

          Error: Attempting to bind a SPECIAL variable defined by
          DEFCONSTANT.

It can't be the first message, because DEFCONSTANT, by doing an implicit

          (proclaim '(special const))

(which pervasively affect BINDINGS and references) FORCES the compiler
to assume that the LET form is binding a SPECIAL variable, not a LEXICAL
variable.  To put it briefly, I was merely arguing that the variable
name `const' in the LET form could not possibly considered a LEXICAL
variable (so how could the compiler warn me about a `lexical'
variable?).

          -- Nick