(/show0 "in don't-bother-after-all case")
(print-it stream)))))
+;;; a hack for debugging
+#!+sb-show
+(defvar *print-object-is-disabled-p*)
+
;;; Output OBJECT to STREAM observing all printer control variables
;;; except for *PRINT-PRETTY*. Note: if *PRINT-PRETTY* is non-NIL,
;;; then the pretty printer will be used for any components of OBJECT,
(output-list object stream)))
(instance
(/show0 "in PRINT-OBJECT case")
- (print-object object stream))
+ #!-sb-show
+ (print-object object stream)
+
+ ;; After being bitten several times by the difficulty of
+ ;; debugging problems around DEFGENERIC PRINT-OBJECT when the old
+ ;; placeholder printer is disabled by FMAKUNBOUND 'PRINT-OBJECT
+ ;; and/or DEFGENERIC has already executed but DEFMETHODs haven't,
+ ;; I added this workaround to allow output during that
+ ;; interval... -- WHN 2001-11-25
+ #!+sb-show
+ (cond ((not (and (boundp '*print-object-is-disabled-p*)
+ *print-object-is-disabled-p*))
+ (print-object object stream))
+ ((typep object 'structure-object)
+ (default-structure-print object stream *current-level*))
+ (t
+ (write-string "#<INSTANCE but not STRUCTURE-OBJECT>"))))
(function
(unless (and (funcallable-instance-p object)
(printed-as-funcallable-standard-class object stream))
;;; by the printer doing bootstrapping, and immediately replace it
;;; with some new printing logic, so that the Lisp printer stays
;;; crippled only for the shortest necessary time.
+(/show0 "about to replace placeholder PRINT-OBJECT with DEFGENERIC")
(let (;; (If we don't suppress /SHOW printing while the printer is
;; crippled here, it becomes really easy to crash the bootstrap
;; sequence by adding /SHOW statements e.g. to the compiler,
;; which kinda defeats the purpose of /SHOW being a harmless
;; tracing-style statement.)
- #+sb-show (*/show* nil))
+ #+sb-show (*/show* nil)
+ ;; (another workaround for the problem of debugging while the
+ ;; printer is disabled here)
+ #+sb-show
+ (sb-impl::*print-object-is-disabled-p* t))
(fmakunbound 'print-object)
(defgeneric print-object (object stream))
(defmethod print-object ((x t) stream)
(print-unreadable-object (x stream :type t :identity t))))
+(/show0 "done replacing placeholder PRINT-OBJECT with DEFGENERIC")
\f
;;;; a hook called by the printer to take care of dispatching to PRINT-OBJECT
;;;; for appropriate FUNCALLABLE-INSTANCE objects
;;; for internal versions, especially for internal versions off the
;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.pre7.86.flaky7.8"
+"0.pre7.86.flaky7.11"