X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos.impure.lisp;h=e923afcd7cc93844b91340a051e39b0f3eb9847e;hb=157e21959c8023f146d6b03206aea6daa60e7b0d;hp=d9155ef823998292ad88fd8c2ef005e42e484bdd;hpb=8bb34dad31b73a7bd4ca17b1630f4f5bdc94f347;p=sbcl.git diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index d9155ef..e923afc 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -913,6 +913,31 @@ (assert (= (slot-value *yao-super* 'obs) 3)) (assert (= (slot-value *yao-sub* 'obs) 3)) +;;; one more MIO test: variable slot names +(defclass mio () ((x :initform 42))) +(defvar *mio-slot* 'x) +(defparameter *mio-counter* 0) +(defmethod update-instance-for-redefined-class ((instance mio) new old plist &key) + (incf *mio-counter*)) + +(let ((x (make-instance 'mio))) + (make-instances-obsolete 'mio) + (slot-value x *mio-slot*)) + +(let ((x (make-instance 'mio))) + (make-instances-obsolete 'mio) + (setf (slot-value x *mio-slot*) 13)) + +(let ((x (make-instance 'mio))) + (make-instances-obsolete 'mio) + (slot-boundp x *mio-slot*)) + +(let ((x (make-instance 'mio))) + (make-instances-obsolete 'mio) + (slot-makunbound x *mio-slot*)) + +(assert (= 4 *mio-counter*)) + ;;; shared -> local slot transfers of inherited slots, reported by ;;; Bruno Haible (let (i)