Comment 7 for bug 1904722

Revision history for this message
Richard M Kreuter (kreuter) wrote :

Oh well, there's an error in my last comment: LIFO order closing won't work for every program. For example:

(defvar *a-stream*)
(defvar *streams* ())
(push (open "foo") *streams*)
(setq *a-stream* (first *streams*))
(push (make-synonym-stream '*a-stream*) *streams*)
(push (open "bar") *streams*)
(setq *a-stream* (first *streams*))

At this point, *STREAMS* contains 3 streams in most-recently-created-first order, but closing them in that order will violate 21.1.4. Nonetheless, if a program wants to close its streams, it ought to do so in a correct order; that ordering will be program-dependent.