D.2 Basic Stream Functions

These generic functions must be defined for all stream classes. [annotate]

stream-element-type  stream [Generic Function]
          

This existing Common Lisp function is made generic, but otherwise behaves the same. Class fundamental-character-stream provides a default method that returns character. [annotate]

[annotate]

open-stream-p  stream [Generic Function]
          

This function is made generic. A default method is provided by class fundamental-stream that returns true if close has not been called on the stream. [annotate]

[annotate]

close  stream &key abort [Generic Function]
          

The existing Common Lisp function close is redefined to be a generic function, but otherwise behaves the same. The default method provided by the class fundamental-stream sets a flag used by open-stream-p. The value returned by close will be as specified by the X3J13 issue closed-stream-operations. [annotate]

[annotate]

stream-pathname  stream [Generic Function]
stream-truename  stream [Generic Function]
          

These are used to implement pathname and truename. There is no default method since these are not valid for all streams. [annotate]

Note: Note that these two functions are extensions to Gray's original proposal, which instead said "PATHNAME and TRUENAME are also permitted to be implemented as generic functions." [edit]-- Richard M Kreuter 2024-07-16 18:44Z
 

[annotate]