Subject: Re: declaring something to be NOT special...
From: Erik Naggum <>
Date: 1998/12/04
Newsgroups: comp.lang.lisp
Message-ID: <>

* David Bakhash <>
| how, in Lisp, do I specifically declare a variable to be NON-special?

  sorry, there's no (standard) way to do that.  (you might still succeed in
  resetting the flag that makes the compiler believe a symbol has special
  binding -- I've had to do that in a running system.)

| I'm afraid that with ACL, if you leave out the (declare (special ...))
| because you specifically don't want that variable to be declared special,
| then the compiler assumes it to be, and this may alter the running of the
| code.

  this is dead wrong.  what happens if you have an unbound variable in your
  code is that Allegro CL treats it _as_if_ it were declared special, i.e.,
  it _assumes_ it is special for that function (or the smallest enclosing
  lexical scope, actually), it does _not_ declare it special for you.
  here's an example:

CL-USER(33): (compile nil (lambda (x) (+ x y)))
; While compiling (:anonymous-lambda 25):
Warning: Free reference to undeclared variable y assumed special.
#<Function (:anonymous-lambda 25) @ #x20791422>

  this means that the code goes to look for Y in the dynamic environment as
  it would a special variable.

  (if you can't make this form work because COMPILE barfs on interpreted
  function objects, let me know, and I'll send you a patch I have made that
  has not yet made the official rounds at Franz Inc.)

  The Microsoft Dating Program -- where do you want to crash tonight?