3.8 Gray Streams

Function: close stream &key abort

Unlike the other Gray stream functions, close is not specialized on t for stream. This decision has been taken mainly for the compatibility reasons with some libraries.

Function: stream-file-position stream &optional position

This is used to implement file-position. When position is not provided it should return the current file position of the stream as non-negative integer or nil if the file position cannot be determined. When position is supplied the file position of the stream should be set to that value. If setting the position is successful then t should be returned, otherwise nil should be returned. The default method always returns nil.

Function: stream-file-length stream

This is used to implement file-length. It returns either a non-negative integer or nil if the concept of file length is not meaningful for the stream. The default method will signal a type-error with an expected type of file-stream. This is required to conform with the “Exceptional Situations” section of file-length in the ANSI specification.

Function: stream-interactive-p stream

This is used to implement interactive-stream-p. It returns a boolean indicating if the stream is interactive. The default method always returns nil.

Function: stream-line-length stream

Allows the default line length to be specified for the stream. It returns either a non-negative integer or nil if the concept of line length is not meaningful for the stream. This value is only used if *print-right-margin* is nil. The line length is used by the pretty printer and by the format justification directive. The default method returns nil.

Function: stream-read-sequence stream sequence &optional start end

This is used to implement read-sequence. It should follow the semantics in the ANSI specification. It returns the position of the first element in the sequence that was not updated. The default method calls stream-read-char or stream-read-byte repeatedly based on the type returned by stream-element-type. Element access to the sequence is done via elt.

Function: stream-write-sequence stream sequence &optional start end

This is used to implement write-sequence. It should follow the semantics in the ANSI specification. It returns sequence without modification. The default method calls stream-write-char or stream-write-byte repeatedly based on the type returned by stream-element-type. Element access to the sequence is done via elt.