From 5c12720ec58f1447a608e0834fcffd408f157b0f Mon Sep 17 00:00:00 2001 From: gerd <gerd> Date: Mon, 12 May 2003 14:20:42 +0000 Subject: [PATCH] Inspect CLOS instances. * src/code/tty-inspect.lisp (describe-parts): Handle standard-object. (describe-standard-object-parts): New function. --- code/tty-inspect.lisp | 14 +++++++++++++- general-info/release-19a.txt | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/code/tty-inspect.lisp b/code/tty-inspect.lisp index fa1f6c5b7..ba9b01263 100644 --- a/code/tty-inspect.lisp +++ b/code/tty-inspect.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/tty-inspect.lisp,v 1.21 2003/02/05 12:34:08 emarsden Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/tty-inspect.lisp,v 1.22 2003/05/12 14:20:42 gerd Exp $") ;;; ;;; ********************************************************************** ;;; @@ -148,6 +148,7 @@ (defun describe-parts (object) (typecase object (symbol (describe-symbol-parts object)) + (standard-object (describe-standard-object-parts object)) (instance (describe-instance-parts object :structure)) (function (if (kernel:funcallable-instance-p object) @@ -169,6 +170,17 @@ (cons "Plist" (symbol-plist object)) (cons "Package" (symbol-package object)))) +(defun describe-standard-object-parts (object) + (collect ((parts)) + (let ((class (class-of object))) + (parts (format nil "~s is an instance of ~s.~%" object class)) + (parts t) + (dolist (slot (mop:class-slots class) (parts)) + (parts (cons (mop:slot-definition-name slot) + (if (mop:slot-boundp-using-class class object slot) + (mop:slot-value-using-class class object slot) + "- (slot is unbound)"))))))) + (defun describe-instance-parts (object kind) (let ((info (layout-info (kernel:layout-of object))) (parts-list ())) diff --git a/general-info/release-19a.txt b/general-info/release-19a.txt index 374c94c39..12a1919de 100644 --- a/general-info/release-19a.txt +++ b/general-info/release-19a.txt @@ -31,6 +31,7 @@ New in this release: - Compiler checking control string and number of args to FORMAT. - TRACE automatically using encapsulation when function-end breakpoints cannot be used. + - INSPECT working on CLOS instances. * Numerous ANSI compliance fixes: - Many bugs in CMUCL's type system detected by Paul Dietz' -- GitLab