Re: Variable never used...

Michael Hannemann <[email protected]> Fri, 28 Jan 2005 11:00:49 -0500
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
Paulo Dias wrote:
>I'm geting this warning...
>
>  Variable never X used....
>
>
>(defun test ( )
>   (let ( (X 0) )
>      (setq X 10)
>   )
>)
>
>Can someone help me...


Well, you set X, but you never actually _do_ anything with it, such as pass 
it to another function or return it from this one, so the compiler is 
warning you that it's not really doing anything.  This isn't an error, just 
a warning that you might want to know.  (Why would you?  Because you might 
have defined a duplicate variable somewhere accidentally and not realized it.)

It's funny; even printing it out is passing it to another function (the 
print function), which is doing something with it.


Hope this helps.

Michael