On Tue, Oct 21, 2008 at 9:15 PM, Kalyanov Dmitry kalyanov.dmitry@gmail.com wrote:
stream closing should be done also in case of stack unwinding.
Right, and it will be done if I write, e.g.
(with-open-file (stream ... ) (iter (for x in-stream stream) (foo x)))
that stream might be created by in-place.
My idea is of something like this: (iter (for x in-stream (open-file .....) close-stream t))
Iterate already has a mechanism for this: the in-file driver, which already does (and should) close the stream.
The point is, when you pass a stream to the driver, iterate doesn't know what the stream is, what you want to do with it, or anything. Why should it close the stream, especially when streams are generally created inside UNWIND-PROTECT-based macros?