+ Anatoly <ram sunct1.jinr.ru>:
| I think this is a bug, or am I wrong?
I think you're wrong, but it would be nice if you had told
us what you
did expect.
| * (let ((a 4)) (declare (special a))
| (let ((a 2))
| (cons a (locally (declare (special a)) a))))
|
| (2 . 4)
Correct: The car here is the inner a, lexical. The cdr is
the outer a (special) because of the LOCALLY declaration.
| * (setq a 3)
| Warning: Declaring A special.
Note the warning: CMUCL has now declared a special for you.
This behaviour is somewhat controversial, though not
illegal, so it is
customizable by using *top-level-auto-declare*.
| * (let ((a 4)) (declare (special a))
| (let ((a 2))
| (cons a (locally (declare (special a)) a))))
|
| (2 . 2)
Correct: Both bindings of a are now special because a was
globally
declared special before. So the outer is not visible, and
only the
inner counts.
I hope this clears up the confusion.
- Harald
|