[Openmcl-devel] Compiler warnings

David L. Rager ragerdl at gmail.com
Fri Oct 16 18:16:50 UTC 2009


Hi Taoufik,

You need to define x to avoid those warnings.

(defvar *x* '(a b c))

Note that I'm fairly sure that defvar only sets a variable's value
upon initialization.  Any subsequent calls to define the same variable
are effectively no-ops.

IIRC, I think that if you're in a multi-threaded environment, not
defining a variable causes the setf's to be thread-local.

David

On Fri, Oct 16, 2009 at 1:12 PM, Taoufik Dachraoui
<taoufik.dachraoui at wanadoo.fr> wrote:
> I tried the following and I got a compiler warning, is this normal? if
> not what is the problem
>
> PS: my .ccl-init.lisp is empty
>
> taoufik-dachraouis-imac:cl-cairo2 taoufik$ ccl
> Welcome to Clozure Common Lisp Version 1.3-r11936  (DarwinX8632)!
> ? (setf x '(a b c))
> (A B C)
> ? (pop x)
> ;Compiler warnings :
> ;   In an anonymous lambda form: Undeclared free variable X (3
> references)
> A
> ? (pprint (macroexpand-1 '(pop x)))
>
> (PROG1 (CAR X) (SETQ X (CDR (THE LIST X))))
> ? (PROG1 (CAR X) (SETQ X (CDR (THE LIST X))))
> ;Compiler warnings :
> ;   In an anonymous lambda form: Undeclared free variable X (3
> references)
> B
> ? x
> (C)
> ?
>
> Taoufik
>
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>



More information about the Openmcl-devel mailing list