[Openmcl-devel] Compiler warnings
taoufik.dachraoui at wanadoo.fr
Sun Oct 18 14:19:21 EDT 2009
On Oct 18, 2009, at 8:12 PM, Gary Palter wrote:
> On Oct 18, 2009, at 1:54 PM, Taoufik Dachraoui wrote:
>> On Oct 18, 2009, at 7:45 PM, Tim Bradshaw wrote:
>>> On 18 Oct 2009, at 18:07, Taoufik Dachraoui wrote:
>>>> n the specs it is said that there is three kinds of variables:
>>>> lexical, dynamic and constant,
>>>> and this is the problem, it seems that the hash on SETF creates a
>>>> variable that is neither
>>>> lexical, nor dynamic nor constant (as show in previous
>>>> submissions); So the question
>>>> is what is the rational behind this hack? why the hack did not
>>>> create a dynamic variable as in CMUCL?
>>> One of the most annoying things about SETF at the top-level in CMUCL
>>> is that it does (or did) effectively declare the name as special.
>>> That can have fairly pervasive and unfortunate side-effects.
>>> So it's a good thing it does not do this in CCL.
>> At the price of having a fourth kind of symbol, but this is not a big
> SETF does not create a symbol. And there is certainly not a fourth
> type of symbol involved.
Forgive my wording; I should have said a binding of X in the global
> You are being confused, still, by the evaluator vs. compiler
> generating warnings.
Not anymore, my concerns was not about the compiler, I just wanted to
why the compiler is raising an error, because I was thinking that X is
a newly create
symbol after running (setf x 1) at top-level, but I was mistaken;
actually SETF binds
the symbol X to 1 in the global environment, and X is neither dynamic,
nor constant and this is why the compiler complains.
As a beginner how do I guess the behavior of SETF when I learned from
that there is three kinds of symbols: dynamic, lexical and constant.
But the (SETF X 1) in CCL does not create a dynamic variable as in
CMUCL and this is
the source of my confusion.
Thank you all
> Take the form, put it in a file and compile the file. You'll get a
> warning that X is not declared.
> [palter at Traveller ~](2)$ cat /tmp/foo.lisp
> (setf x 1)
> [palter at Traveller ~](3)$ dx86cl
> Welcome to Clozure Common Lisp Version 1.4-dev-r13020M-trunk
> ? (compile-file "/tmp/foo.lisp")
> ;Compiler warnings for "/tmp/foo.lisp" :
> ; In an anonymous lambda form at position 0: Undeclared free
> variable X
> ? (load "/tmp/foo")
> ? x
>> All this discussions could be avoided if SETF raises an error when
>> trying to bind a non
>> existing symbol (it is fortunate to me because I learned a little
>> of CCL now and I
>> practicied my dormant english).
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
More information about the Openmcl-devel