Changeset 7593


Ignore:
Timestamp:
Nov 5, 2007, 6:09:16 AM (12 years ago)
Author:
gz
Message:

make print-object catch any errors and just print #<error printing object>. This can be disabled (e.g. if you're debugging print methods) by setting *print-catch-errors* to nil

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-io.lisp

    r6192 r7593  
    224224(defvar *current-length* nil) ; must be nil at top level
    225225
     226(defvar *print-catch-errors* t)
    226227
    227228;;;; ======================================================================
     
    450451                                                          (%i- list-kludge 1)
    451452                                                          list-kludge)))))
     453
     454(defmethod print-object :around ((object t) stream)
     455  (if *print-catch-errors*
     456    (handler-case (call-next-method)
     457      (error () (write-string "#<error printing object>" stream)))
     458    (call-next-method)))
    452459
    453460(defmethod print-object ((object t) stream)
Note: See TracChangeset for help on using the changeset viewer.