diff --git a/pcl/slots.lisp b/pcl/slots.lisp index 6cb3c866e7634ba7247234b74fa25a8782832ebc..224dbc8c97f809051c6a0e269b711f9d0ed84a3f 100644 --- a/pcl/slots.lisp +++ b/pcl/slots.lisp @@ -27,6 +27,16 @@ (in-package :pcl) +;;; ANSI CL condition for unbound slots. + +(define-condition unbound-slot (cell-error) + ((instance :reader unbound-slot-instance :initarg :instance) + (slot :reader unbound-slot-slot :initarg :slot)) + (:report (lambda(condition stream) + (format stream "The slot ~S is unbound in the object ~S" + (unbound-slot-slot condition) + (unbound-slot-instance condition))))) + (defmethod wrapper-fetcher ((class standard-class)) 'std-instance-wrapper) @@ -355,7 +365,7 @@ instance)) (defmethod slot-unbound ((class t) instance slot-name) - (error "The slot ~S is unbound in the object ~S." slot-name instance)) + (error 'unbound-slot :slot slot-name :instance instance)) (defun slot-unbound-internal (instance position) (slot-unbound (class-of instance) instance