[cmucl-help] Re: Buffered stream output bug report

2008-09-13 Thread Steven Edwards

A thanks to Ray who has helped.

Here's the workaround:

(defun put-char (my-stream my-char)
  "Put a character on the given stream."
  (if (eq my-stream t)
(write-char my-char *standard-output*)
(write-char my-char my-stream)))

(defun put-string (my-stream my-string)
  "Put a string on the given stream."
  (if (eq my-stream t)
(write-string my-string *standard-output*)
(write-string my-string my-stream)))

== Steven

On Sep 13, 2008, at 1:40 PM, Raymond Toy wrote:


Steven Edwards wrote:

Banner:

CMU Common Lisp 19e (19E), running on gail
With core: /Users/sje/cmucl-19e-x86-darwin/lib/cmucl/lib/lisp.core
Dumped on: Thu, 2008-05-01 20:38:02-04:00 on macmini
See  for support information.
Loaded subsystems:
  Python 1.1, target Intel x86
  CLOS based on Gerd's PCL 2004/04/14 03:32:47


Three related bugs:

(defun bug0 (my-stream)
(write-char #\1 my-stream)
(format my-stream "~D" 2)
(write-char #\3 my-stream))

Let's see.  CLHS says for write-char, T means *terminal-io*.  And T  
for
format means *standard-output*.  Hence, write-char and format send  
their

output to different places.  On cmucl,  *standard-output* and
*terminal-io* are different streams.  Looking at the stream objects,
they go to different Unix file descriptors, and the file descriptors  
are

different.

For all the tests you provide, if you specify *standard-output*, you  
get

the results you want.  I guess gcl and clisp have *terminal-io* and
*standard-output* being essentially the same stream.





[cmucl-help] Re: Buffered stream output bug report

2008-09-13 Thread Raymond Toy
Steven Edwards wrote:
> Banner:
>
> CMU Common Lisp 19e (19E), running on gail
> With core: /Users/sje/cmucl-19e-x86-darwin/lib/cmucl/lib/lisp.core
> Dumped on: Thu, 2008-05-01 20:38:02-04:00 on macmini
> See  for support information.
> Loaded subsystems:
>Python 1.1, target Intel x86
>CLOS based on Gerd's PCL 2004/04/14 03:32:47
>
>
> Three related bugs:
>
> (defun bug0 (my-stream)
>  (write-char #\1 my-stream)
>  (format my-stream "~D" 2)
>  (write-char #\3 my-stream))
>
Let's see.  CLHS says for write-char, T means *terminal-io*.  And T for
format means *standard-output*.  Hence, write-char and format send their
output to different places.  On cmucl,  *standard-output* and
*terminal-io* are different streams.  Looking at the stream objects,
they go to different Unix file descriptors, and the file descriptors are
different.

For all the tests you provide, if you specify *standard-output*, you get
the results you want.  I guess gcl and clisp have *terminal-io* and
*standard-output* being essentially the same stream.

I think this is allowed behavior.

Ray, who hopes he got this right.