[Ecls-list] turn off auto declares

Juan Jose Garcia Ripoll lisp at arrakis.es
Mon Nov 21 06:16:04 UTC 2005


On Mon, 2005-11-21 at 18:08 +1100, Dean O'Connor wrote:
> Hi all,
> 
> In ECL Is there a way to turn off the auto declaring of variables when 
> using setq/f ?
> 
> eg. if a function calls (setq x 1) and x is not declared beforehand, I 
> would like an error instead of the auto creation and assign of the 
> special variable.
> 
> Its seems CMUCL has a way of doing it. See question 2 here: 
> http://www.cons.org/cmucl/FAQ.html

I do not see this work on my copy of CMUCL (19a-release-20 from
Debian) :-/ See below that the behavior of the compiler is independent
of the variable they mention: it always signals an error on undefined
variables, much like ECL. Hence, ext:*top-level-auto-declare* only
controls how interpreted forms behave, and even then it is only a
warning, not an error.

Is this what you meant?

Juanjo

-------------

* (setq s 1)
Warning:  Declaring S special.

1
* (setq ext:*top-level-auto-declare* nil)

NIL
* (compile 'foo '(lambda () (setq s 1)))
; Compiling LAMBDA NIL:
; Compiling Top-Level Form:

; In: LAMBDA NIL

;   (SETQ S 1)
; Warning: Undefined variable S
; ;

; Warning: This variable is undefined:
;   S
;

; Compilation unit finished.
;   2 warnings


FOO
NIL
NIL
* (foo)

1






More information about the ecl-devel mailing list