[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: incf gives compiler warnings

> Welcome to Macintosh Common Lisp Version 2.0b1p3!
> ? (setq a 1 b 2)
> 2
> ? (incf a b)
> ;Compiler warnings :
> ;   Undeclared free variable B, in an anonymous lambda form.
> ;   Undeclared free variable A (2 references), in an anonymous lambda form.
> 3
> ?
> 	Is this a bug, or should the compiler give these warnings (version
> 	1.3.2 doesn't)?
> 	I discovered this when I wrote a couple of define-modify-macros,
> 	which also give similar warnings.

This is not related to INCF, the problem is that A and B have not been
declared as variables and the compiler warns you about that...
The following wont give you any warnings.

(defvar a 1)
(defvar b 2)
(incf a b)

Guillaume Cartier
LACIM, Universite du Quebec a Montreal.
Bureau: (514) 987-4290
E-Mail: cartier@math.uqam.ca