CLCS
Function

make-echo-stream

make-echo-stream input-stream output-streamecho-stream

Arguments and Values

input-streaman input stream.
output-streaman output stream.
echo-streaman echo stream.

Description

Creates and returns an echo stream that takes input from input-stream and sends output to output-stream.

Examples

 (let ((out (make-string-output-stream)))
    (with-open-stream 
        (s (make-echo-stream
            (make-string-input-stream "this-is-read-and-echoed")
            out))
      (read s)
      (format s " * this-is-direct-output")
      (get-output-stream-string out)))
⇒  "this-is-read-and-echoed * this-is-direct-output"