## [Sbcl-help] Schrödinger variable (an undefined consequence)

 [Sbcl-help] Schrödinger variable (an undefined consequence) From: Giovanni Gigante - 2009-10-20 22:07:17 ```I have found a dreadful example of the infamous "undefined consequences" which took me a lot of time to diagnose: (defvar *a* nil) (proclaim '(type (simple-array integer) *a*)) (defun x () (when *a* (break "~a" *a*))) no one complains when I enter this (on SBCL 1.0.29), but then, invoking (x) triggers the break. So, the value of *a* seem to be true and NIL and the same time, like the Schrödinger cat. I understand that the hyperspec says "At the moment the scope of the declaration is entered, the consequences are undefined if the value of the declared variable is not of the declared type.", and nil is not a simple-array... still, rather frightening. Maybe SBCL should give some warning at that troubling proclamation? ```

 [Sbcl-help] Schrödinger variable (an undefined consequence) From: Giovanni Gigante - 2009-10-20 22:07:17 ```I have found a dreadful example of the infamous "undefined consequences" which took me a lot of time to diagnose: (defvar *a* nil) (proclaim '(type (simple-array integer) *a*)) (defun x () (when *a* (break "~a" *a*))) no one complains when I enter this (on SBCL 1.0.29), but then, invoking (x) triggers the break. So, the value of *a* seem to be true and NIL and the same time, like the Schrödinger cat. I understand that the hyperspec says "At the moment the scope of the declaration is entered, the consequences are undefined if the value of the declared variable is not of the declared type.", and nil is not a simple-array... still, rather frightening. Maybe SBCL should give some warning at that troubling proclamation? ```