[Openmcl-devel] Compiler warnings
taoufik.dachraoui at wanadoo.fr
Sun Oct 18 11:38:44 UTC 2009
On Oct 18, 2009, at 1:21 PM, Ron Garret wrote:
> On Oct 18, 2009, at 4:14 AM, Taoufik Dachraoui wrote:
>> Also, I would like to insist on the fact that SETF creates a
>> lexical variable (on behavior at least,
>> it is weird for me to say that because for me when I learned Common
>> Lisp I was told that
>> there a daynamic and lexical variables).
> Insist all you want, that won't make you right.
>> The following example shows that SETF creates a lexical variable
>> (because f always returns
>> the value of x as defined by SETF)
> No, it doesn't:
> ? (setf x 1)
> ? (defun f () (+ x 1))
> ;Compiler warnings :
> ; In F: Undeclared free variable X
> ? (let ((x pi)) (declare (special x)) (f))
> ? x
This shows that x is really special, it behaves as lexical unless you
declare it special
According to the specs, special specifies that the variable x is
dynamic and that x
refers to the current dynamic binding. But recall before the special
declaration x was not
dynamic. As the example shows, x is a lexical variable.
>> If you do not agree please explain in more details so I learn and
>> understand something new.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Openmcl-devel