From: Spiros Bousbouras
Subject: Declaration SPECIAL
Date: 
Message-ID: <1f46f1b9-15dd-4667-a67e-ba8d103e0543@s19g2000prg.googlegroups.com>
The HS page on "Declaration SPECIAL" contains the following
example:

(setf (symbol-value 'x) 6)
(defun bar (x y)            ;[1] 1st occurrence of x
  (let ((old-x x)           ;[2] 2nd occurrence of x -- same as 1st
occurrence
        (x y))              ;[3] 3rd occurrence of x
    (declare (special x))
    (list old-x x)))
(bar 'first 'second) =>  (FIRST SECOND)

I don't understand what point the example is meant to
illustrate. As far as I can see and my tests confirm,
declaring x as special does not affect the behaviour.
From: Juho Snellman
Subject: Re: Declaration SPECIAL
Date: 
Message-ID: <87d4p5kfxu.fsf@vasara.proghammer.com>
Spiros Bousbouras <······@gmail.com> writes:

> The HS page on "Declaration SPECIAL" contains the following
> example:
> 
> (setf (symbol-value 'x) 6)
> (defun bar (x y)            ;[1] 1st occurrence of x
>   (let ((old-x x)           ;[2] 2nd occurrence of x -- same as 1st
> occurrence
>         (x y))              ;[3] 3rd occurrence of x
>     (declare (special x))
>     (list old-x x)))
> (bar 'first 'second) =>  (FIRST SECOND)
> 
> I don't understand what point the example is meant to
> illustrate. As far as I can see and my tests confirm,
> declaring x as special does not affect the behaviour.

It's illustrating that the SPECIAL declaration applies only to the
variable X introduced in (X Y), not to the X in (OLD-X X). That is,
it does not work like:

  (setf (symbol-value 'x) 6)
  (defun bar (x y)
    (let ((old-x (locally (declare (special x)) x))
          (x y))
      (declare (special x))
      (list old-x x)))

-- 
Juho Snellman