+(defmethod attribute-slot-value (instance attribute)
+ "Return (VALUES slot-value-or-nil existsp boundp
+
+If this attribute, in its current context, refers to a slot,
+we return slot-value-or nil either boundp or not."
+ (let (existsp boundp slot-value-or-nil)
+ (cond
+ ((and (slot-boundp attribute 'slot-name) (slot-name attribute))
+ (when (slot-exists-p instance (slot-name attribute))
+ (setf existsp t)
+ (when (slot-boundp instance (slot-name attribute))
+ (setf boundp t
+ slot-value-or-nil (slot-value
+ instance
+ (slot-name attribute))))))
+ ((and (slot-exists-p instance (attribute-name attribute)))
+ (setf existsp t)
+ (when (slot-boundp instance (attribute-name attribute))
+ (setf boundp t
+ slot-value-or-nil (slot-value
+ instance
+ (attribute-name attribute))))))
+ (VALUES slot-value-or-nil existsp boundp)))
+