- (push (cons (dsd-%name dd-slot)
- (funcall (dsd-accessor dd-slot) object))
- parts-list)))))
-
-(defun describe-function-parts (object)
- (let* ((type (sb-kernel:get-type object))
- (object (if (= type sb-vm:closure-header-type)
- (sb-kernel:%closure-function object)
- object)))
- (list (format nil "Function ~S.~@[~%Argument List: ~A~]." object
- (sb-kernel:%function-arglist object)
- ;; Defined-from stuff used to be here. Someone took
- ;; it out. FIXME: We should make it easy to get
- ;; to DESCRIBE from the inspector.
- )
- t)))
-
-(defun describe-vector-parts (object)
- (list* (format nil "The object is a ~:[~;displaced ~]vector of length ~D.~%"
- (and (sb-impl::array-header-p object)
- (sb-impl::%array-displaced-p object))
- (length object))
- nil
- (coerce object 'list)))
-
-(defun describe-cons-parts (object)
- (list* (format nil "The object is a LIST of length ~D.~%" (length object))
- nil
- object))
-
-(defun index-string (index rev-dimensions)
+ (push (cons (dsd-name dd-slot)
+ (funcall (dsd-accessor-name dd-slot) object))
+ parts-list)))))
+
+(defmethod inspected-parts ((object structure-object))
+ (values (format nil "The object is a STRUCTURE-OBJECT of type ~S.~%"
+ (type-of object))
+ t
+ (inspected-structure-elements object)))
+
+(defun inspected-standard-object-elements (object)
+ (let ((reversed-elements nil)
+ (class-slots (sb-pcl::class-slots (class-of object))))
+ (dolist (class-slot class-slots (nreverse reversed-elements))
+ (let* ((slot-name (slot-value class-slot 'sb-pcl::name))
+ (slot-value (if (slot-boundp object slot-name)
+ (slot-value object slot-name)
+ *inspect-unbound-object-marker*)))
+ (push (cons slot-name slot-value) reversed-elements)))))
+
+(defmethod inspected-parts ((object standard-object))
+ (values (format nil "The object is a STANDARD-OBJECT of type ~S.~%"
+ (type-of object))
+ t
+ (inspected-standard-object-elements object)))
+
+(defmethod inspected-parts ((object sb-mop:funcallable-standard-object))
+ (values (format nil "The object is a ~S of type ~S.~%"
+ 'sb-mop:funcallable-standard-object (type-of object))
+ t
+ (inspected-standard-object-elements object)))
+
+(defmethod inspected-parts ((object condition))
+ (values (format nil "The object is a CONDITION of type ~S.~%"
+ (type-of object))
+ t
+ (inspected-standard-object-elements object)))
+
+(defmethod inspected-parts ((object function))
+ (values (format nil "The object is a ~A named ~S.~%"
+ (if (closurep object) 'closure 'function)
+ (nth-value 2 (function-lambda-expression object)))
+ t
+ ;; Defined-from stuff used to be here. Someone took
+ ;; it out. FIXME: We should make it easy to get
+ ;; to DESCRIBE from the inspector.
+ (list*
+ (cons "Lambda-list" (%fun-lambda-list object))
+ (cons "Ftype" (%fun-type object))
+ (when (closurep object)
+ (list
+ (cons "Closed over values" (%closure-values object)))))))
+
+#+sb-eval
+(defmethod inspected-parts ((object sb-eval:interpreted-function))
+ (values (format nil "The object is an interpreted function named ~S.~%"
+ (nth-value 2 (function-lambda-expression object)))
+ t
+ ;; Defined-from stuff used to be here. Someone took
+ ;; it out. FIXME: We should make it easy to get
+ ;; to DESCRIBE from the inspector.
+ (list
+ (cons "Lambda-list" (sb-eval:interpreted-function-lambda-list object))
+ (cons "Definition" (function-lambda-expression object))
+ (cons "Documentation" (sb-eval:interpreted-function-documentation object)))))
+
+(defmethod inspected-parts ((object vector))
+ (values (format nil
+ "The object is a ~:[~;displaced ~]VECTOR of length ~W.~%"
+ (and (array-header-p object)
+ (%array-displaced-p object))
+ (length object))
+ nil
+ ;; FIXME: Should we respect *INSPECT-LENGTH* here? If not, what
+ ;; does *INSPECT-LENGTH* mean?
+ (coerce object 'list)))
+
+(defun inspected-index-string (index rev-dimensions)