[Openmcl-devel] Compiler warnings
taoufik.dachraoui at wanadoo.fr
Sun Oct 18 07:50:46 EDT 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
we cannot declare a lexical variable as special. But the variables
by SETF are not dynamic and we can declare them as special. So the
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
Recall that I showed an example of SETF in CMUCL. CMUCL SETF defines a
variable and raises a warning because the variable was not declared
using DEFVAR or
I think someone should carrefully look at this issues and decide what
to do with them.
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
>> 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