get-output-stream-string
(get-output-stream-string stream)
Returns everything written to a make-string-output-stream stream so far, and clears it: the next call answers only what was written after this one. That is Common Lisp's contract, and it is what lets one accumulator stream be reused for a sequence of tokens. A stream of another kind (a string input stream, a file, a synonym stream, ...), and a string output stream that has been closed (its text is released on close), signals a type-error whose expected type is (and string-stream (satisfies output-stream-p)), and a value that is not a stream one whose expected type is stream.