home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / lisp / 2386 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.8 KB

  1. Path: sparky!uunet!crdgw1!ge-dab!puma.ATL.GE.COM!newshost!sjameson
  2. From: sjameson@fergie.dnet.ge.com (Stephen M Jameson)
  3. Newsgroups: comp.lang.lisp
  4. Subject: Function to print in #S format
  5. Message-ID: <SJAMESON.92Sep8161926@fergie.dnet.ge.com>
  6. Date: 8 Sep 92 20:19:26 GMT
  7. Sender: news@puma.ATL.GE.COM (USENET News System)
  8. Reply-To: sjameson@atl.ge.com
  9. Organization: General Electric Advanced Technology Labs
  10. Lines: 23
  11.  
  12. This ought to be a FAQ, but I haven't seen it.  How do I print a structure in
  13. #S-format, i.e. so that the reader will automatically reconstruct the
  14. structure?  The application is obvious: I would like to have a :PRINT-FUNCTION
  15. specified in the DEFSTRUCT which will print in a concise, non-readable format
  16. if a certain switch is set, and print in the verbose, readable format if the
  17. switch is not set.  On the Symbolics I figured out a way to do it but it did
  18. not seem portable, and CLTL2 doesn't mention anything beyond the semantics of
  19. #S format, and that if you don't specify a :PRINT-FUNCTION, "a function is
  20. provided for the structure which will print out all its slots using #S syntax."
  21.  
  22. -- Steve
  23.  
  24.  
  25. --
  26. Steve Jameson                           General Electric Aerospace 
  27. sjameson@atl.ge.com                     Advanced Technology Laboratories
  28.                                         Moorestown, New Jersey              
  29. ****************************************************************************
  30. **  . . . but I do not love the sword for its sharpness, nor the arrow    **
  31. **  for its swiftness, nor the warrior for his glory.  I love only that   **
  32. **  which they defend . . .                                               **
  33. **    -- Faramir, "The Two Towers"                                        **
  34. ****************************************************************************
  35.