0.8.2.39:
[sbcl.git] / contrib / sb-aclrepl / inspect.lisp
index c48984c..476b9eb 100644 (file)
@@ -1,4 +1,4 @@
-;;;; Inspector for sb-aclrepl
+/nick;;;; Inspector for sb-aclrepl
 ;;;;
 ;;;; The documentation, which may or may not apply in its entirety at
 ;;;; any given time, for this functionality is on the ACL website:
@@ -56,6 +56,7 @@ The commands are:
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defvar *inspect-unbound-object-marker* (gensym "INSPECT-UNBOUND-OBJECT-")))
 
+
 (defun inspector-fun (object input-stream output-stream)
   (declare (ignore input-stream))
   (let ((*current-inspect* nil)
@@ -452,7 +453,7 @@ POSITION is NIL if the id is invalid or not found."
   "Returns elements of an object that have been trimmed and labeled based on
 length and skip. Returns (VALUES ELEMENTS LABELS ELEMENT-COUNT)
 where ELEMENTS and LABELS are vectors containing ELEMENT-COUNT items.
-LABELS may be a string, number, cons pair, :tail, or :ellipses.
+LABELS elements may be a string, number, cons pair, :tail, or :ellipses.
 This function may return an ELEMENT-COUNT of up to (+ 3 length) which would
 include an :ellipses at the beginning, :ellipses at the end,
 and the last element."
@@ -650,7 +651,7 @@ cons cells and LIST-TYPE is :normal, :dotted, or :cyclic"
 (defmethod inspected-description ((object fixnum))
   (description-maybe-internals "fixnum ~W" (list object)
                               "[#x~8,'0X]"
-                              (sb-kernel:get-lisp-obj-address object)))
+                              (ash object (1- sb-vm:n-lowtag-bits))))
 
 (defmethod inspected-description ((object complex))
   (format nil "complex number ~W" object))
@@ -677,10 +678,14 @@ cons cells and LIST-TYPE is :normal, :dotted, or :cyclic"
   (format nil "ratio ~W" object))
 
 (defmethod inspected-description ((object character))
-  (description-maybe-internals "character ~W char-code #x~4,'0X"
+  ;; FIXME: This will need to change as and when we get more characters
+  ;; than just the 256 we have today.
+  (description-maybe-internals "character ~W char-code #x~2,'0X"
                               (list object (char-code object))
                               "[#x~8,'0X]"
-                              (sb-kernel:get-lisp-obj-address object)))
+                              (logior sb-vm:base-char-widetag 
+                                      (ash (char-code object)
+                                           sb-vm:n-widetag-bits))))
 
 (defmethod inspected-description ((object t))
   (format nil "a generic object ~W" object))
@@ -755,7 +760,7 @@ cons cells and LIST-TYPE is :normal, :dotted, or :cyclic"
        (info (sb-kernel:layout-info (sb-kernel:layout-of object))))
     (when (sb-kernel::defstruct-description-p info)
       (dolist (dd-slot (sb-kernel:dd-slots info) (nreverse components-list))
-       (push (cons (sb-kernel:dsd-%name dd-slot)
+       (push (cons (string (sb-kernel:dsd-name dd-slot))
                    (funcall (sb-kernel:dsd-accessor-name dd-slot) object))
              components-list)))))