Strange princ behavior in clisp 
Author Message
 Strange princ behavior in clisp

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



Tue, 15 Feb 2005 00:28:31 GMT  
 Strange princ behavior in clisp

Quote:

> 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?


Tue, 15 Feb 2005 01:04:16 GMT  
 Strange princ behavior in clisp

Quote:

> 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



Tue, 15 Feb 2005 01:51:49 GMT  
 Strange princ behavior in clisp
Quote:


> > 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



Tue, 15 Feb 2005 02:11:44 GMT  
 Strange princ behavior in clisp
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.


Quote:

> > 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



Tue, 15 Feb 2005 04:59:04 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Strange instance class valiable behavior

2. Strange behavior of VM with Delphi COM Servers.

3. AXValueConvertingControlSite strange behavior

4. Strange news groups behavior

5. Strange behavior of AWK I can't understand

6. Strange RB3 behavior

7. windows 2000 strange behavior on save

8. Strange compilation behavior RB2

9. ABC Browse - Strange Behavior

10. Strange Browse Box Behavior when App is minimized - 5PE

11. C55H - strange behavior for required button

12. Strange behavior of CW ReportWriter-cross-posted from cw-talk

 

 
Powered by phpBB® Forum Software