X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Finspect.lisp;h=37e04c8311b65b356ca8b92ee491d8b1f9d44e00;hb=6129b1ebc5125c57d6446c061155f5f653f41725;hp=f059e883b9a67ded308129579409953f406ab545;hpb=4898ef32c639b1c7f4ee13a5ba566ce6debd03e6;p=sbcl.git diff --git a/src/code/inspect.lisp b/src/code/inspect.lisp index f059e88..37e04c8 100644 --- a/src/code/inspect.lisp +++ b/src/code/inspect.lisp @@ -108,17 +108,12 @@ evaluated expressions. (return-from %inspect (reread))))))))) (defun eval-for-inspect (command stream) - (let ((result-list (restart-case (multiple-value-list (eval command)) + (let ((result-list (restart-case + (multiple-value-list (interactive-eval command)) (nil () :report "Return to the inspector." (format stream "~%returning to the inspector~%") (return-from eval-for-inspect nil))))) - ;; FIXME: Much of this interactive-EVAL logic is shared with - ;; the main REPL EVAL and with the debugger EVAL. The code should - ;; be shared explicitly. - (setf /// // // / / result-list) - (setf +++ ++ ++ + + - - command) - (setf *** ** ** * * (car /)) - (format stream "~&~{~S~%~}" /))) + (format stream "~&~{~S~%~}" result-list))) (defun tty-display-inspected-parts (description named-p elements stream) (format stream "~%~A" description) @@ -198,9 +193,9 @@ evaluated expressions. t (inspected-standard-object-elements object))) -(defmethod inspected-parts ((object funcallable-instance)) - (values (format nil "The object is a FUNCALLABLE-INSTANCE of type ~S.~%" - (type-of object)) +(defmethod inspected-parts ((object sb-mop:funcallable-standard-object)) + (values (format nil "The object is a ~S of type ~S.~%" + 'sb-mop:funcallable-standard-object (type-of object)) t (inspected-standard-object-elements object))) @@ -211,19 +206,32 @@ evaluated expressions. (inspected-standard-object-elements object))) (defmethod inspected-parts ((object function)) - (values (format nil "The object is a ~A named ~S.~%" - (if (closurep object) 'closure 'function) - (%fun-name object)) - t - ;; Defined-from stuff used to be here. Someone took - ;; it out. FIXME: We should make it easy to get - ;; to DESCRIBE from the inspector. - (list* - (cons "Lambda-list" (%fun-lambda-list object)) - (cons "Ftype" (%fun-type object)) - (when (closurep object) - (list - (cons "Closed over values" (%closure-values object))))))) + (values (format nil "The object is a ~A named ~S.~%" + (if (closurep object) 'closure 'function) + (nth-value 2 (function-lambda-expression object))) + t + ;; Defined-from stuff used to be here. Someone took + ;; it out. FIXME: We should make it easy to get + ;; to DESCRIBE from the inspector. + (list* + (cons "Lambda-list" (%fun-lambda-list object)) + (cons "Ftype" (%fun-type object)) + (when (closurep object) + (list + (cons "Closed over values" (%closure-values object))))))) + +#+sb-eval +(defmethod inspected-parts ((object sb-eval:interpreted-function)) + (values (format nil "The object is an interpreted function named ~S.~%" + (nth-value 2 (function-lambda-expression object))) + t + ;; Defined-from stuff used to be here. Someone took + ;; it out. FIXME: We should make it easy to get + ;; to DESCRIBE from the inspector. + (list + (cons "Lambda-list" (sb-eval:interpreted-function-lambda-list object)) + (cons "Definition" (function-lambda-expression object)) + (cons "Documentation" (sb-eval:interpreted-function-documentation object))))) (defmethod inspected-parts ((object vector)) (values (format nil