STREAM-CAPABILITIESNote: earlier versions of this issue tried to solve another problem as well. See discussion section.
INTERACTIVE-STREAM-P stream
Returns T if the stream is interactive, otherwise NIL. Signals an error of type TYPE-ERROR if the argument is not a stream.
The precise meaning of INTERACTIVE-STREAM-P is implementation dependent, and may depend on the underlying operating system. However the general intent is to distinguish between interactive and batch (or background or command-file) operations.
Some examples of the things that might identify a stream as interactive include: 1. The stream is connected to a person (or equivalent) in such a way that the program can prompt for information and expect to receive different input depending on the prompt. 2. The program is expected to prompt for input and support "normal input editing". 3. READ-CHAR might hang waiting for the user to type something instead of quickly returning a character or EOF.
*TERMINAL-IO* might or might not be interactive.
INTERACTIVE-STREAM-P has been proposed several times and is clearly needed by any program that alters its behavior depending on whether it is interacting with a user or running in a "batch" mode.
Note that some proposed features for telling whether two streams are connected to the same source or sink of information have been removed from this version of the proposal. These were the functions STREAM-SAME-SOURCE-P, STREAM-SAME-DESTINATION-P, STREAM-SOURCE-ID-LIST, and STREAM-DESTINATION-ID-LIST. These could be revived in another proposal if desired, but Moon thought INTERACTIVE-STREAM-P was important and didn't want it to be lost due to controversy over these unrelated functions.