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

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



William Edward Webber <wew@yallara.cs.rmit.edu.au> writes:
> 
> > (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)

The culprit is *print-pretty* = t. The pretty printer outputs the #\newline
object to an auxiliary stream, sees that it spans lines and proceeds to
think "Must be a big object. It will be prettier if I output a newline
first.", and only then copies the contents of the auxiliary stream to
standard output. Nice hack fights back...

I'll fix it for the next release. Thank you for reporting that.

                 Bruno