[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Unsolicited typeout
I have a problem about functions doing unsolicited typeout. The manual
is somewhat silent on this issue and the next edition should make its
intent more clear. For example, the manual makes no statement about
whether CONS or EQUAL does typeout, but I hope we agree that it's not
a good idea for them to do so. I think the manual should be tightened
up in this regard.
VAXLISP 1.2 (for example) outputs "FOO compiled." every time COMPILE
or COMPILE-FILE compiles something. Symbolics' Common Lisp (for example)
does not. This is very problemsome if I want a program that secretly
compiles things to have identical I/O behavior in both systems.
I suppose I could bind *STANDARD-OUTPUT* around calls to COMPILE but
that seems a little silly. And besides, VAXLISP 1.2 outputs compiler
warnings to *STANDARD-OUTPUT* rather than *ERROR-OUTPUT*, so I'd also
miss warnings if I bound *STANDARD-OUTPUT* (something that wouldn't
happen in Symbolics' Common Lisp).
I can't call these bugs in VAXLISP, because the manual doesn't say that
COMPILE doesn't do typeout to *STANDARD-OUTPUT*. Nor does it say that
COMPILE is obliged to call WARN (or even to simulate its behavior)
when reporting problems. Nevertheless, I hope that a future standard
will be written in such a way that things like this could be treated
as simple bugs.
In general, I feel that the next edition of the manual should make
it very clear that certain kinds of actions (such as output to
*STANDARD-OUTPUT*) are implicitly forbidden unless there is an explicit
statement to the contrary. The same text should also expressly allow
anything to do output to *ERROR-OUTPUT* at any time, since that can
be safely bound to something else in contexts where warnings need to
be suppressed without affecting the "normal" I/O behavior of the
program in question.
By the way, I get tired of writing
(WITH-OUTPUT-TO-STRING (*STANDARD-OUTPUT*)
...)
around things that I want to portably suppress output from (and then
throwing away the result string). It's inefficient and doesn't say
what I mean. In the absence of a protocol for making generalized
user-defined streams, I would like very much if we would provide a
WITH-OUTPUT-DISCARDED special form (or macro) that would say and do
what I really mean to be doing. Alternatively, if there were a
variable that held a stream that did this output and I could do
(LET ((*STANDARD-OUTPUT* *NULL-OUTPUT-STREAM*)) ...), that would
suffice.
I might be ammenable to a new stream, *WINDY-OUTPUT* which was a
stream to which "extra" output could be sent in situations where
extra-verbose output might or might not be allowed. I'd have to study
this in more detail before committing to it, but I thought I'd note
the idea. eg, COMPILE and COMPILE-FILE mentioned above might could
use this, and also LOAD (which I complained in earlier mail types
out the name of every function loaded in some implementations but
not in others). I'm not sure if we could make this rigorous enough
to be useful, but at least people could bind *WINDY-OUTPUT* to
*NULL-OUTPUT-STREAM*.