The standard function close
is implemented as a generic function. All external resources used by the stream should be freed and true returned when that has been done. The result value for close
is as per the Common Lisp ANSI specification.
When stream is an instance of a subclass of buffered-stream, if abort is true then any remaining data in the buffer can be discarded. There are two built-in methods on buffered-stream. The primary method specialized on buffered-stream returns t
. The other, an around method specialized on buffered-stream, checks whether the stream is closed, and if it is does nothing, including not calling the next method, which means not doing any of the primary, before and after methods. If the stream is opened, it flushes the stream buffer if abort is nil
, calls the next method and marks the stream as closed if that method returns true. Thus the only requirement for a primary method specialized on a subclass of buffered-stream is that it must close any underlying data source and return true.
close
method on the
fundamental-stream class sets a flag for open-stream-pLispWorks User Guide and Reference Manual - 13 Feb 2015