Subject: Re: Scoping Question
From: (Rob Warnock)
Date: Thu, 10 Nov 2005 22:14:36 -0600
Newsgroups: comp.lang.lisp
Message-ID: <>
Alan Crowe  <> wrote:
| It is a bug in CMUCL. The bug is that the text of the
| warning message is wrong.
| The specification doesn't say what is to be done with 
| (setf x 'something) at the top level [absent a decl.]...
| So CMUCL gets to chose what to do with a bare, toplevel
| (setf x). It choses to proclaim it to be special, just as if
| you had preceded it by (defvar x). That's OK.
| Then it gives a warning message
|     Warning:  Declaring X special.
| It could have said "Proclaiming X special" but it doesn't.

This is made more amusing(?) by the fact that it really *is* merely
PROCLAIM'ing! From the CMUCL code for EVAL in "src/code/eval.lisp":

	     (let ((symbol (first name)))
	       (case (info variable kind symbol)
		  (case *top-level-auto-declare*
		     (warn "Declaring ~S special." symbol))
		     (return (eval:internal-eval original-exp))))
#| Here ==> |#	  (proclaim `(special ,symbol)))
		  (return (eval:internal-eval original-exp)))))

| In fact, when it issues this warning message, CMUCL is
| proclaiming that the symbol is special, which will break
| closures. So the text of the warning message is wrong.

Easily fixed...  ;-}  ;-}

    cmu> (compile-file "eval-patch.lisp")
    cmu> (load *)

    ; Loading #p"/usr/u/rpw3/eval-patch.x86f".
    ...[drop into debugger because of locked package, select CONTINUE]...
    cmu> (setf foo 37)
    Warning:  Proclaiming FOO special.


Is that better?  ;-}  ;-}


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607