0.7.12.38:
[sbcl.git] / tests / clos.impure.lisp
index e3efc72..73a68bb 100644 (file)
 ;;; we should be able to make classes with uninterned names:
 (defclass #:class-with-uninterned-name () ())
 \f
+;;; SLOT-MISSING should be called when there are missing slots.
+(defclass class-with-all-slots-missing () ())
+(defmethod slot-missing (class (o class-with-all-slots-missing)
+                        slot-name op
+                        &optional new-value)
+  op)
+(assert (eq (slot-value (make-instance 'class-with-all-slots-missing) 'foo)
+           'slot-value))
+(assert (eq (funcall (lambda (x) (slot-value x 'bar))
+                    (make-instance 'class-with-all-slots-missing))
+           'slot-value))
+(assert (eq (funcall (lambda (x) (setf (slot-value x 'baz) 'baz))
+                    (make-instance 'class-with-all-slots-missing))
+           'setf))
+\f
 ;;;; success
 (sb-ext:quit :unix-status 104)