November 2010
Intermediate to advanced
504 pages
12h 45m
English
Streams are usually used for communicating with the outside world from within a Lisp program. One exception to this is the string stream, which simply makes a string look like a stream. In the same way you can read or write to external resources with other types of streams, a string stream will let you read or write to a string.
You can create string streams with the make-string-output-stream and make-string-input-stream commands. Following is an example that uses make-string-output-stream:
>(defparameter foo (make-string-output-stream))>(princ "This will go into foo. " foo)>(princ "This will also go into foo. " foo)>(get-output-stream-string foo)"This will go into foo. This will also go into foo. "
You may ...