Next: , Previous: , Up: The language   [Contents][Index]

5.24 Streams

A stream is a Lisp object which is either a data sink (an output stream) or a data source (an input stream). All streams produce or consume sequences of 8-bit characters.

Streams are very flexible, functions using streams for their input and output do not need to know the type of stream being accessed. For example the Lisp reader (the read function) takes an input stream as its sole argument, it then reads characters from this stream until it has parsed a whole object. This stream could be a file, a function, or even a string; the read function does not need to differentiate.

Function: streamp arg

Return true if arg is a stream.

Function: input-stream-p arg

Return true if arg is an input stream.

Function: output-stream-p arg

Return true if arg is an output stream.