[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this correct behaviour for (princ ...)



>> an extra blank line is inserted between each line using clisp (1997-09-22),
>> whereas if I use (write-char ...) instead of (princ ...) the file is copied
>> correctly.
>
>I don't understand how this is possible. `princ' on a character does a
>`write-char'; I just looked at the code. Are you on Win32 ? Does your
>file contain CR/LFs as line terminators or simple LFs? What does
>(mapc #'princ '(#\x #\cr #\newline #\y)) print on your screen? Do you
>have dribbling enabled?

Hi!

> (mapc #'princ '(#\x #\cr #\newline #\y))
x

y
(#\x #\Return #\Newline #\y)
> (mapc #'write-char '(#\x #\cr #\newline #\y))
x
y
(#\x #\Return #\Newline #\y)
> 

both running in an xterm and as an inferior process under Emacs.  

Also:

> (mapc #'princ '(#\x #\newline #\newline #\y))
x


y
(#\x #\Newline #\Newline #\y)
> (mapc #'princ '(#\x #\newline #\d #\newline #\y))
x

d

y
(#\x #\Newline #\d #\Newline #\y)
> (mapc #'write-char '(#\x #\newline #\d #\newline #\y))
x
d
y
(#\x #\Newline #\d #\Newline #\y)
> 
etc.

To questions 1, 2, and 4: my OS is Linux, it was a standard Unix file (i.e.
LFs only), dribbling was not enabled.  

Is this a peculiarity with the Linux ELF binary of 1997-09-22?  Is there
any other debugging info I can give you?

Regards,

William Webber