[Openmcl-devel] local special on symbol-macro

Tobias C. Rittweiler tcr at freebits.de
Thu Oct 22 02:58:42 PDT 2009


Tim Bradshaw <tfb at tfeb.org> writes:

> This also makes sense of the restriction for global symbol macros.   
> The only thing a non-binding-affecting SPECIAL declaration can do is  
> to let you see a special binding which is shadowed by an inner lexical  
> binding:
>
> (let ((x 1))
>    (declare (special x))
>    (let ((x 2))
>      (values x (locally (declare (special x))
>                  x))))
>
> But for DEFINE-SYMBOL-MACRO there can be no "outer" binding, so the  
> only thing a special declaration could apply to is the symbol macro,  
> and those are not allowed to be special.

I don't think it makes sense. For example, in the following

  (define-symbol-macro .foo. :global-symbol-macro)

  (defun foo ()
    (declare (special .foo.))
    .foo.)

  (let ((.foo. :special))
    (declare (special .foo.))
    (print (foo)))

you'd want your compiler to compile the reference to .FOO. in the
function FOO as a reference to a (yet unknown) special variable.

Albeit, following the standard, an implementation must signal an error
on discovering the special declaration of .FOO., though.

  -T.




More information about the Openmcl-devel mailing list