X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Finspect.lisp;h=5625d641ad5817c90a01d0819de27dc2ced6a6b7;hb=860543cc7ba0266e41e1d41ac9b6a208f3795f1a;hp=ed2b1759cc03ce55bae3a2ff5c951f18cad780e5;hpb=926e669f7dc4e38c69b116db24d1a3150d2ee6ab;p=sbcl.git diff --git a/src/code/inspect.lisp b/src/code/inspect.lisp index ed2b175..5625d64 100644 --- a/src/code/inspect.lisp +++ b/src/code/inspect.lisp @@ -55,10 +55,11 @@ evaluated expressions. (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 @@ -66,6 +67,7 @@ evaluated expressions. ;; 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) @@ -170,7 +172,7 @@ evaluated expressions. (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)))))