[Openmcl-devel] Compiler warnings
Taoufik Dachraoui
taoufik.dachraoui at wanadoo.fr
Sun Oct 18 04:50:46 PDT 2009
I would like to recap the issues:
1. (THE type form)
should compares type with the type of the returned value of form
2. at top-level
(SETF var form)
defines a variable that is not dynamic but and not exactly lexical
either, because
we cannot declare a lexical variable as special. But the variables
defined
by SETF are not dynamic and we can declare them as special. So the
vaiable
is not dynamic and is not lexical.
I think that SETF should define a global lexical variable if the
variable is not
previously defined by DEFVAR or DEFPARAMETER (unlike CMUCL SETF se
below).
Recall that I showed an example of SETF in CMUCL. CMUCL SETF defines a
special
variable and raises a warning because the variable was not declared
using DEFVAR or
DEFPARAMETER.
I think someone should carrefully look at this issues and decide what
to do with them.
Taoufik
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
> ?
>
>>
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20091018/9cff167c/attachment.htm>
More information about the Openmcl-devel
mailing list