Subject: Re: [clisp-list] Strange princ behavior

From: [email-masked]
Date: Thu Aug 29 11:54:02 2002

Sam,
      that did the trick.  (and of course, I'm using version 2.28, not 2.82
=-) ).  For future reference, what would be the best place to find out
about implementation-specific behavior like this?

Thanks,
Glenn G. Burnside III
National Instruments

                      Sam Steingold                                                                                                                 
                      <[email-masked]>            To:      [email-masked]                                                                       
                                               cc:      [email-masked]                                                            
                      08/29/2002 01:41         Subject: Re: [clisp-list] Strange princ behavior                                                     
                      PM                                                                                                                            
                      Please respond                                                                                                                
                      to sds                                                                                                                        

> * In message
<[email-masked]>
> * On the subject of "[clisp-list] Strange princ behavior"
> * Sent on Thu, 29 Aug 2002 13:09:55 -0500
> * Honorable [email-masked] writes:
>
> I'm hoping someone can point in the right direction.  I have some macros
> that are generating groups of calls to princ, which look something like
> this:
>
> (progn (princ "hello ") (princ "world."))
>
> This generates output to the stream
> hello world.
>
> As I would expect.  But when the second princ string has a newline in it,
> such as
> (progn (princ "hello ") (princ "world,
>   how are you"))
>
> I don't get
> hello world,
>   how are you
>
> I get
> hello
> world,
>   how are you.
>
> In short, the second princ is always preceded by a newline, but only when
> the string itself contains a newline.

Indeed, this is the case.  When *PRINT-PRETTY* is non-NIL, CLISP printer
will print multi-line object starting with a FRESH-LINE.

> Is this standard print behavior for strings?
> Is this a bug in CLISP?

no: pretty printing is largely left to the implementation.

> Am I doing something pathologically stupid?

just (setq *print-pretty* nil)

> incidently, I am using CLISP 2.82 on Windows XP.

I am using what will eventually become 2.30 -
you are 52+ versions ahead of me! :-)

--
Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html
We're too busy mopping the floor to turn off the faucet.

---

From: Sam Steingold <[email-masked]>
Date: Thu Aug 29 12:20:13 2002

> * In message <[email-masked]>
> * On the subject of "Re: [clisp-list] Strange princ behavior"
> * Sent on Thu, 29 Aug 2002 13:53:06 -0500

your specific question is actually answered in full detail here:
<http://clisp.cons.org/impnotes.html#ppr-first-newline>

see also:
<http://clisp.cons.org/>
<http://clisp.cons.org/faq.html>
<http://clisp.cons.org/clisp.html>
<http://clisp.cons.org/impnotes.html>

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Lisp is a language for doing what you've been told is impossible. - Kent Pitman