Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!samsung!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: Structure question Message-ID: <1991Jan25.203223.25843@Think.COM> Date: 25 Jan 91 20:32:23 GMT References: <1991Jan25.115153.2864@kub.nl> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 26 In article lou@cs.rutgers.edu writes: >1) Revise your print function so that under some circumstance it >prints the structure in the #S( ... ) form. E.g. it might check the >global variable *print-pretty*, and if it is NIL print the #S form. Actually, *PRINT-ESCAPE* is supposed to be used for this purpose. When it is true the implication is that computer-parsable formatting should be used when it is available; when it is NIL the implication is that the output is only intended for human consumption. *PRINT-PRETTY* is only supposed to affect whitespace. This generally means that when it is true spaces should be turned into newlines followed by whitespace in order to make the nesting structure more obvious. Pretty-printing can be done with both escaped and unescaped output. By the way, ANSI CL is adding another variable, *PRINT-READABLY*, which is even stronger than *PRINT-ESCAPE*. See pp.557-8 of CLtL2 for a description, but basically it is used to specify that an error should be signalled if there is no computer-parsable printed representation for an object being printed (*PRINT-ESCAPE* specifies a preference, while *PRINT-READABLY* specifies a requirement). -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar