Open generic function
Reads a number of elements from an input stream.
read input-stream n #key on-end-of-stream => sequence-or-eof
<stream>.
<integer>.
<object>.
<sequence>, or an instance of <object> if the end of stream is reached.
io
streams
Returns a sequence of the next n elements from input-stream.
The type of the sequence returned depends on the type of the stream's underlying aggregate. For instances of <sequence-stream>, the type of the result is given by type-for-copy of the underlying aggregate. For instances of <file-stream>, the result is a vector that can contain elements of the type returned by calling stream-element-type on the stream.
The stream position is advanced so that subsequent reads start after the n elements.
If the stream is not at its end, read waits until input becomes available.
If the end of the stream is reached before all n elements have been read, the behavior is as follows.
read.
<incomplete-read-error> condition is signaled. When signaling this condition, read supplies two values: a sequence of the elements that were read successfully, and n.
<end-of-stream-error> condition is signalled.
<end-of-stream-error>, page 67