[Openmcl-devel] Compiler warnings

Taoufik Dachraoui taoufik.dachraoui at wanadoo.fr
Sun Oct 18 10:12:54 PDT 2009


On Oct 18, 2009, at 6:55 PM, Jeremy Jones wrote:

>
> On Sun, Oct 18, 2009 at 12:35 PM, Taoufik Dachraoui
> <taoufik.dachraoui at wanadoo.fr> wrote:
> ...
>>
>> ? (setf lst '(1 2 3))
>> ? (push 0 lst)
>> ? lst
>> (0 1 2 3)
>> ? (pop lst)
>> Warning
>> ? lst
>> (1 2 3)
>>
>> push did not raise a warning and pop did.
>>
>
> The warning inconsistencies are because some things are evaluated and
> some things are compiled.  If the evaluator punts and calls the
> compiler it calls ccl::compile-named-function.  If you (trace
> ccl::compile-named-function), you will see a trace every time the
> evaluator calls the compiler.  Compiler warnings only occur when the
> compiler is called.  This will help you see when the compiler is
> called and when it isn't.
>

The inconsistencies are because of the SETF hack, I do not understand  
why
at top-level (SETF X 1) causes the creation of a symbol that neither  
dynamic, nor
lexical nor constant, eventhough in the specs there is only three kind  
of variables:
lexical, dynamic, constant;

And this explains why I could not understand the reason for which the  
compiler
raises a warnning; if the SETF hack caused the creation of dynamic  
variable (as in CMUCL)
we will not have this warning at all.

Maybe there is a rational behind this hack; Why X after (SETF X 1) is  
not a special variable
(dynamic)?

Taoufik








More information about the Openmcl-devel mailing list