Skip to content
Snippets Groups Projects
Commit 5c12720e authored by gerd's avatar gerd
Browse files

Inspect CLOS instances.

	* src/code/tty-inspect.lisp (describe-parts): Handle
	standard-object.
	(describe-standard-object-parts): New function.
parent e780f46d
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (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 @@ ...@@ -148,6 +148,7 @@
(defun describe-parts (object) (defun describe-parts (object)
(typecase object (typecase object
(symbol (describe-symbol-parts object)) (symbol (describe-symbol-parts object))
(standard-object (describe-standard-object-parts object))
(instance (describe-instance-parts object :structure)) (instance (describe-instance-parts object :structure))
(function (function
(if (kernel:funcallable-instance-p object) (if (kernel:funcallable-instance-p object)
...@@ -169,6 +170,17 @@ ...@@ -169,6 +170,17 @@
(cons "Plist" (symbol-plist object)) (cons "Plist" (symbol-plist object))
(cons "Package" (symbol-package 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) (defun describe-instance-parts (object kind)
(let ((info (layout-info (kernel:layout-of object))) (let ((info (layout-info (kernel:layout-of object)))
(parts-list ())) (parts-list ()))
......
...@@ -31,6 +31,7 @@ New in this release: ...@@ -31,6 +31,7 @@ New in this release:
- Compiler checking control string and number of args to FORMAT. - Compiler checking control string and number of args to FORMAT.
- TRACE automatically using encapsulation when function-end - TRACE automatically using encapsulation when function-end
breakpoints cannot be used. breakpoints cannot be used.
- INSPECT working on CLOS instances.
* Numerous ANSI compliance fixes: * Numerous ANSI compliance fixes:
- Many bugs in CMUCL's type system detected by Paul Dietz' - Many bugs in CMUCL's type system detected by Paul Dietz'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment