[pro] Defined but no used variable warning during setf expansion

Pascal J. Bourguignon pjb at informatimago.com
Tue Jan 24 06:04:43 UTC 2012


Burton Samograd <burton.samograd at gmail.com> writes:

> CL-USER> (setf $x 10)
> ; in: SETF (#:G1129 X)
> ;     (LET* ((#:G1175 X))
> ;       (MULTIPLE-VALUE-BIND (#:G1176)
> ;           10
> ;         (LET ((#:G1177 #))
> ;           (WHEN #:G1177 (FUNCALL #:G1177 # #:G1176))
> ;           (SETF X #:G1176))))
> ;
> ; caught STYLE-WARNING:
> ;   The variable #:G1175 is defined but never used.


I don't think it's a compiler error (there's no reason to treat
uninterned symbols differently from interned ones).


Clearly, there's a single occurence of #:G1175, in the binding of the
LET* form, and no use of it.  You should either avoid generating it, or
add a

    (declare (ignorable #:G1175)) 

expression before the body of the LET*.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.




More information about the pro mailing list