Subject: Re: defvar and (declaim (special ...))
From: Erik Naggum <erik@naggum.no>
Date: 1999/04/13
Newsgroups: comp.lang.lisp
Message-ID: <3132955585679736@naggum.no>

* Barry Margolin <barmar@bbnplanet.com>
| My .emacs has lots of (setq <variable> <value>) expressions for variables
| that are defined in files that I autoload.  The autoloaded files won't be
| loaded until I actually try to use one of those facilities.  I don't need
| declarations, because the Emacs byte compiler doesn't warn about these
| expressions, not to mention that SPECIAL declarations are meaningless in
| Emacs Lisp, since it's dynamically scoped.  But if Emacs required
| pre-declaration of these variables, I would use DECLAIM rather than
| DEFVAR, to avoid the "multiple DEFVAR of same variable" issue.

  what good would a declaration do, though?  SETQ at top-level would write
  to the value slot of the symbol, and it doesn't matter much whether the
  symbol is declared special or not at this time.  the first DEFVAR to come
  around would declare it special, but at that time, BOUNDP would be true
  of that symbol, so DEFVAR wouldn't touch the value.

#:Erik