+(define-condition instance-structure-protocol-error
+ (reference-condition error)
+ ((slotd :initarg :slotd :reader instance-structure-protocol-error-slotd)
+ (fun :initarg :fun :reader instance-structure-protocol-error-fun))
+ (:report
+ (lambda (c s)
+ (format s "~@<The slot ~S has neither ~S nor ~S ~
+ allocation, so it can't be ~A by the default ~
+ ~S method.~@:>"
+ (instance-structure-protocol-error-slotd c)
+ :instance :class
+ (cond
+ ((member (instance-structure-protocol-error-fun c)
+ '(slot-value-using-class slot-boundp-using-class))
+ "read")
+ (t "written"))
+ (instance-structure-protocol-error-fun c)))))
+
+(defun instance-structure-protocol-error (slotd fun)
+ (error 'instance-structure-protocol-error
+ :slotd slotd :fun fun
+ :references (list `(:amop :generic-function ,fun)
+ '(:amop :section (5 5 3)))))
+