(named-let reread ()
(format s "~&> ")
(force-output)
- (let (;; KMP idiom, using stream itself as EOF value
- (command (read *standard-input* nil *standard-input*)))
- (typecase command
- (stream ; i.e. EOF
+ (let* (;; newly-consed object for hermetic protection against
+ ;; mischievous input like #.*EOF-OBJECT*:
+ (eof (cons *eof-object* nil))
+ (command (read *standard-input* nil eof)))
+ (when (eq command eof)
;; currently-undocumented feature: EOF is handled as Q.
;; If there's ever consensus that this is *the* right
;; thing to do (as opposed to e.g. handling it as U), we
;; do this than to signal an error.
(/show0 "THROWing QUIT-INSPECT for EOF")
(throw 'quit-inspect nil))
+ (typecase command
(integer
(let ((elements-length (length elements)))
(cond ((< -1 command elements-length)
(defgeneric inspected-parts (object))
(defmethod inspected-parts ((object symbol))
- (values (format nil "The object is a SYMBOL.~%" object)
+ (values (format nil "The object is a SYMBOL.~%")
t
(list (cons "Name" (symbol-name object))
(cons "Package" (symbol-package object))
(info (layout-info (sb-kernel:layout-of object))))
(when (sb-kernel::defstruct-description-p info)
(dolist (dd-slot (dd-slots info) (nreverse parts-list))
- (push (cons (dsd-%name dd-slot)
+ (push (cons (dsd-name dd-slot)
(funcall (dsd-accessor-name dd-slot) object))
parts-list)))))
(values (format nil "The object is a FUNCALLABLE-INSTANCE of type ~S.~%"
(type-of object))
t
- (inspected-structure-elements object)))
+ (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))
(let* ((type (sb-kernel:widetag-of object))