Default streams for the standard streams.
hcl
The value of cl:*terminal-io*.
The variables *background-input*
, *background-output*
and *background-query-io*
are default streams for the standard Common Lisp streams.
These variables are all set to the value of cl:*terminal-io* when the image starts, but when the LispWorks IDE starts it sets:
*background-output*
to mp:*background-standard-output*
.*background-input*
to a stream that always returns EOF.*background-query-io*
to a stream that interacts with the user using CAPI prompters.
The default value of each of the standard streams is a synonym stream referencing one of these background streams:
*background-input*
.*background-output*
.*background-query-io*
.
Thus when the LispWorks IDE is running, output to the standard output streams goes to the mp:*background-standard-output*
, and can be viewed in the Output tab of the Listener and Editor windows, and the Output Browser tool. Trying to read from *standard-input* once the environment is running returns EOF. Using *query-io* causes on-screen prompting.
The main purpose of these variables is to redirect the standard input and output streams once the LispWorks IDE is running, because writing to cl:*terminal-io* is not useful in most cases.
You can set or rebind these variables if required, and this changes the default destination of the standard streams.
Processes that are created by CAPI for an interface while the IDE is running rebind the standard input, output and query I/O streams to themselves (so setting them in these processes does not change the global value). This does not happen on processes that are not created by CAPI, and does not happen when the LispWorks IDE is not running, in particular in delivered applications. When the LispWorks IDE is running, the output to standard output stream on other processes will still go by default to the mp:*background-standard-output*
, because *background-output*
is set to it.
These variables were new in LispWorks 7.0.
In LispWorks 6.1 and earlier versions, CAPI processes in the LispWorks IDE bound the output streams to mp:*background-standard-output*
, the standard input to a stream that returns EOF and *QUERY-IO* to a stream that interacts with the user using CAPI prompters. Hence, for these processes, the default behavior has not changed. However input and output on other processes was going to/from the cl:*terminal-io* by default, which caused various problems. The main purpose of these variables is to fix these problems.
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:35