- Code: Select all
* (setf westvleteren 12)
; (SETF WESTVLETEREN 12)
; ==>
; (SETQ WESTVLETEREN 12)
;
; caught WARNING:
; undefined variable: WESTVLETEREN
;
; compilation unit finished
; Undefined variable:
; WESTVLETEREN
; caught 1 WARNING condition
=> 12
I was not surprised by the warnings, but I was surprised by the fact that it returned a value. So I had a look at what the symbol now contained:
- Code: Select all
* westvleteren
=> 12
It got my value. Weird. But what does describe say?
- Code: Select all
* (describe 'westvleteren)
COMMON-LISP-USER::WESTVLETEREN
[symbol]
WESTVLETEREN names an undefined variable:
Value: 12
; No value
What does "undefined variable" mean, if it has a value? Is this behaviour defined, or is it implementation-dependant?
$ sbcl --version
SBCL 1.0.40.0.debian