From: Glenn Burnside
Subject: Strange princ behavior in clisp
Date: 
Message-ID: <umsits4ajsvid7@corp.supernews.com>
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.

Is this standard print behavior for strings?  Is this a bug in CLISP?  Am I
doing something pathologically stupid?

incidently, I am using CLISP 2.82 on Windows XP.

Thanks for any help,
    Glenn Burnside

From: Kent M Pitman
Subject: Re: Strange princ behavior in clisp
Date: 
Message-ID: <sfwptw1k35b.fsf@shell01.TheWorld.com>
"Glenn Burnside" <·········@austin.rr.com> 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.
> 
> Is this standard print behavior for strings?  Is this a bug in CLISP?  Am I
> doing something pathologically stupid?
> 
> incidently, I am using CLISP 2.82 on Windows XP.

looks to me like just a bug.  did you ask the implementors?
From: Andreas Hinze
Subject: Re: Strange princ behavior in clisp
Date: 
Message-ID: <3D6E5F35.DBE5DC4C@smi.de>
"Glenn Burnside" <·········@austin.rr.com> 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.
>
> Is this standard print behavior for strings?  Is this a bug in CLISP?  Am I
> doing something pathologically stupid?
>
> incidently, I am using CLISP 2.82 on Windows XP.

I tried it with lispWorks. Same result as yours.
But however it prints exactly what you gave to it as argument (indeed there
is a newline in the string).

Best
AHz
From: Glenn Burnside
Subject: Re: Strange princ behavior in clisp
Date: 
Message-ID: <umt2p4hhcp514d@corp.supernews.com>
Got an answer from the Sam Steingold - this is a CLISP behavior when
*pretty-print* is true.  There is also a custom variable in CLISP that
controls newline behavior when pretty-printing.  setting *pretty-print* to
nil makes the extra newline go away.

"Andreas Hinze" <···@smi.de> wrote in message
······················@smi.de...
> "Glenn Burnside" <·········@austin.rr.com> 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.
> >
> > Is this standard print behavior for strings?  Is this a bug in CLISP?
Am I
> > doing something pathologically stupid?
> >
> > incidently, I am using CLISP 2.82 on Windows XP.
>
> I tried it with lispWorks. Same result as yours.
> But however it prints exactly what you gave to it as argument (indeed
there
> is a newline in the string).
>
> Best
> AHz
From: Andreas Hinze
Subject: Re: Strange princ behavior in clisp
Date: 
Message-ID: <3D6E63E0.42714768@smi.de>
Andreas Hinze wrote:
> 
> "Glenn Burnside" <·········@austin.rr.com> 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.
> >
> > Is this standard print behavior for strings?  Is this a bug in CLISP?  Am I
> > doing something pathologically stupid?
> >
> > incidently, I am using CLISP 2.82 on Windows XP.
> 
> I tried it with lispWorks. Same result as yours.
> But however it prints exactly what you gave to it as argument (indeed there
> is a newline in the string).
> 
> Best
> AHz
Please ignore the last mail. I made a mistake while typing the code to lispworks.
After correcting it the result was:
hello world,
   how are you
"world,
   how are you"
That look's ok.

Sorry for the noise.
Best
AHz