On Tue, 22 Jun 2004 at 12:55:12 +0200, Andras Simon wrote:
> CL-USER(10): (let ((s (make-synonym-stream '*standard-output*)))
> (print "foo" s))
> CL-USER(2): (let ((s (make-synonym-stream '*debug-io*)))
> (print "foo" s))
> Debugger invoked on condition of type TYPE-ERROR:
> The value #<STREAM @ #x883357> is not of type character output stream.
> 0: TOP-LEVEL Return to top level.
>  CL-USER(11):
> And there are problems with one-way streams, too:
> CL-USER(11): (let ((s (make-synonym-stream '*standard-output*)))
> (stream-element-type s))
> Assertion failed!
> at org.armedbear.lisp.Debug.assertTrue(Unknown Source)
> and abcl dies.
I haven't investigated these exact problems in detail, but there's a
big refactoring waiting to happen in the stream code, and I think once
that refactoring is done, these problems will magically go away.
Maybe I can do a bit of work in this area while I'm ostensibly on
> Unrelated to the previous issues:
> Speaking of streams, I think the following patch is reasonable, but
> the stream implementation is much too hairy for me to know for sure.
> diff -u -r1.256 Lisp.java
> --- org/armedbear/lisp/Lisp.java 15 Jun 2004 01:03:07 -0000 1.256
> +++ org/armedbear/lisp/Lisp.java 22 Jun 2004 10:46:49 -0000
> @@ -1509,9 +1509,9 @@
> return checkCharacterOutputStream(_STANDARD_OUTPUT_.symbolValueNoThrow(
> - public static final Stream getTraceOutput()
> + public static final Stream getTraceOutput() throws ConditionThrowable
> - return (Stream) _TRACE_OUTPUT_.symbolValueNoThrow();
> + return
> public static final Symbol _READTABLE_ =
Well, it's reasonable, but chances are good that getTraceOutput() will
disappear as part of the aforementioned refactoring, so I'm not sure
you'll achieve what you're hoping to achieve.
(What are you hoping to achieve?)
Even after the big refactoring, you should be able to do the equivalent
thing inline, like this:
Stream stream =
getTraceOutput() was introduced as a convenience function at a very
early stage of development, but I don't think it's really needed any