CLCS
Function

make-two-way-stream

make-two-way-stream input-stream output-streamtwo-way-stream

Arguments and Values

input-streama stream.
output-streama stream.
two-way-streama two-way stream.

Description

Returns a two-way stream that gets its input from input-stream and sends its output to output-stream.

Examples

 (with-output-to-string (out)
    (with-input-from-string (in "input...")
      (let ((two (make-two-way-stream in out)))
        (format two "output...")
        (setq what-is-read (read two))))) ⇒  "output..."
 what-is-read ⇒  INPUT... 

Exceptional Situations

Should signal an error of type type-error if input-stream is not an input stream. Should signal an error of type type-error if output-stream is not an output stream.