X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Fprint.lisp;h=b53c9ec622f6f4dcef9f5d9ced00883887a4b7c8;hb=3277bf7fd150b594708ae1227a428aa5ad945f71;hp=7da9efefc226089ec5649aa39791b02dec948c74;hpb=079ef9dad558ca07cb8178ef428bf738112174fa;p=sbcl.git diff --git a/src/code/print.lisp b/src/code/print.lisp index 7da9efe..b53c9ec 100644 --- a/src/code/print.lisp +++ b/src/code/print.lisp @@ -21,7 +21,7 @@ "If true, all objects will printed readably. If readable printing is impossible, an error will be signalled. This overrides the value of *PRINT-ESCAPE*.") -(defvar *print-escape* T +(defvar *print-escape* t #!+sb-doc "Should we print in a reasonably machine-readable way? (possibly overridden by *PRINT-READABLY*)") @@ -1630,23 +1630,15 @@ nil) (defun output-fun (object stream) - (let* ((*print-length* 3) ; in case we have to.. - (*print-level* 3) ; ..print an interpreted function definition - ;; FIXME: This find-the-function-name idiom ought to be - ;; encapsulated in a function somewhere. - (name (case (fun-subtype object) - (#.sb!vm:closure-header-widetag "CLOSURE") - (#.sb!vm:simple-fun-header-widetag (%simple-fun-name object)) - (t 'no-name-available))) - (identified-by-name-p (and (symbolp name) - (fboundp name) - (eq (fdefinition name) object)))) - (print-unreadable-object (object - stream - :identity (not identified-by-name-p)) - (prin1 'function stream) - (unless (eq name 'no-name-available) - (format stream " ~S" name))))) + (let* ((*print-length* 3) ; in case we have to.. + (*print-level* 3) ; ..print an interpreted function definition + (name (%fun-name object)) + (proper-name-p (and (legal-fun-name-p name) (fboundp name) + (eq (fdefinition name) object)))) + (print-unreadable-object (object stream :identity (not proper-name-p)) + (format stream "~:[FUNCTION~;CLOSURE~]~@[ ~S~]" + (closurep object) + name)))) ;;;; catch-all for unknown things