home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / lisp / 2068 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.1 KB  |  31 lines

  1. Newsgroups: comp.lang.lisp
  2. Path: sparky!uunet!decwrl!parc!gregor
  3. From: gregor@parc.xerox.com (Gregor Kiczales)
  4. Subject: Re: Beware of print-object methods when debugging
  5. In-Reply-To: mlg@siemens.com.'s message of 21 Jul 92 17:55:57 GMT
  6. Message-ID: <GREGOR.92Jul21211018@tracer-bullet.parc.xerox.com>
  7. Followup-To: comp.lang.lisp
  8. Sender: news@parc.xerox.com
  9. Organization: Xerox Palo Alto Research Center
  10. References: <mlg.711741357@volvo>
  11. Date: 21 Jul 92 21:10:18
  12. Lines: 17
  13.  
  14.  
  15. Yes, this is one of many ways to lose with print-object methods.  I
  16. sometimes think it would be nice if implementations provided some sort
  17. of switch, whereby you could disable the call to PRINT-OBJECT or
  18. something.  Of course, you can do this on an application specific basis,
  19. by writing all your methods in the form:
  20.  
  21. (defmethod print-object ((o foo) str)
  22.   (if *use-default-printer*
  23.       (call-next-method)
  24.       (print-unreadable... )))
  25.  
  26. In fact, in an application we have here, I have set it up so that, when
  27. running on a particular kind of machine, something very much like this
  28. is controlled by whether the mode lock key is held down.
  29.  
  30. Gregor
  31.