[Openmcl-devel] Compiler warnings

Ron Garret ron at flownet.com
Sun Oct 18 05:56:55 UTC 2009


On Oct 17, 2009, at 10:24 PM, Taoufik Dachraoui wrote:

> I compared openmcl and cmucl and found that openmcl setf create a  
> lexical variable

Not quite.  OpenMCL (which is now called CCL) simply binds the value  
in the global environment without making the variable either lexical  
or dynamic.  You can still bind it both ways:

? (setf x 1)
1
? (defun foo () x)
;Compiler warnings :
;   In FOO: Undeclared free variable X
FOO
? (let ((x 2)) (foo))
;Compiler warnings :
;   In an anonymous lambda form: Unused lexical variable X
1
? (let ((x 2)) (declare (special x)) (foo))
2

It's very confusing, which is one reason I occasionally advocate  
against CL's design for global variables.  You might want to look at  
this:

http://rondam.blogspot.com/2009/08/global-variables-done-right.html

rg




More information about the Openmcl-devel mailing list