2.10 Streams

A stream is a source or sink of data, typically characters or bytes. Nearly all functions that perform I/O do so with respect to a specified stream. The function open takes a pathname and returns a stream connected to the file specified by the pathname. There are a number of standard streams that are used by default for various purposes. See chapter 21.

There are subtypes of type stream: broadcast-stream, concatenated-stream, echo-stream, synonym-stream, string-stream, file-stream, and two-way-stream are disjoint subtypes of stream. Note particularly that a synonym stream is always and only of type synonym-stream, regardless of the type of the stream for which it is a synonym.