[Openmcl-devel] Compiler warnings

Daniel Weinreb dlw at itasoftware.com
Wed Oct 21 08:33:57 PDT 2009

Ron Garret wrote:
>> I agree with all of this.  The only thing that (setq a 4)
>> at top level can possibly mean, if it's not considered
>> to be illegal, is to treat the symbol a as a dynamic variable.
> That's clearly not true, because CCL neither signals an error nor 
> treats the symbol as a dynamic variable.  So there's a constructive 
> existence proof of a third option.
I think we are having a vocabulary problem.  In the sense
in which I am using the word, CCL treats it like a dynamic

The following paragraph will make sense (even if you
disagree with it) if I am understanding your use of
the vocabulary as you mean it; not, if not.

Whether a symbol has been declared special is one of the
inputs to the decision that the evaluator makes as to
whether to treat a symbol (when seen in context of
being a varible) as dynamic versus lexical.  Although
a top level "(setq x 5)" does not declare the symbol x
special, Lisp nevertheless treats it as a special variable.
>> I'm not sure I'd interpret it that way.  The thing is a symbol,
>> and it acts like a dynamic variable when used in this way.
> No, it doesn't.  If it did then you could no longer make lexical 
> closures using that symbol in the lambda list.  But you can.  So it 
> isn't a dynamic variable according to the spec.
If the symbol were declared special, you could no longer (etc).
The symbol is not declared special.  But Lisp is treating
the symbol as a dynamic variable, the way I'm using those

The wording in the spec may not be consistent with the
way I'm using the words.  (The spec is not always internally
consistent about vocabulary.)
>> But the bottom line is that there's no entirely satisfactory
>> answer.
> I think there are two satisfactory answers.  I think CCL's current 
> behavior is satisfactory, notwithstanding that it is outside the 
> standard.  I also have a proposed replacement implemented in portable 
> CL that I've cited before.
> What about these do you find unsatisfactory?
That (setq x 3) is not well-defined is, to me, unsatisfactory.
>> OK, I guess you could say that defvar "creates
>> a variable" in a sense, even though it does not actually
>> create any Lisp object per se.
> A variable is NOT a lisp object.
I know.  That's why I said "could" and "in a sense".
> A variable is (according to the spec) a binding, and bindings are not 
> first-class in CL.  (They can be made first-class.  This is one of the 
> things that my LEXICONS system does.)
>>  That is, the symbol foo
>> in (defvar foo 1) wasn't created by the defvar.
> That's true.  But the variable named by FOO was.
Note that the Hyperspec page on "defvar" does not
ever refer to "creating" a variable.

It does talk about "establishing" a symbol as a dynamic
variable, which I take to be synonymous with declarating
or proclaiming a symbol as a dynamic variable.  It's not the
same thing.

> rg

More information about the Openmcl-devel mailing list