[Openmcl-devel] Compiler warnings
Taoufik Dachraoui
taoufik.dachraoui at wanadoo.fr
Sun Oct 18 04:38:44 PDT 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)
> 1
> ? (defun f () (+ x 1))
> ;Compiler warnings :
> ; In F: Undeclared free variable X
> F
> ? (let ((x pi)) (declare (special x)) (f))
> 4.141592653589793D0
> ? x
> 1
> ?
>
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.
>>
>
> See:
>
> http://www.flownet.com/ron/specials.pdf
>
> rg
>
>
Taoufik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20091018/3e5968d0/attachment.htm>
More information about the Openmcl-devel
mailing list