[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue: CLOSED-STREAM-OPERATIONS (Version 4)



I'm probably at least as uncomfortable with your way of thinking about it as
you are with mine. However, I think they're both fairly arbitrary positions
which can only be successfully argued for in terms of some set of pragmatic
details which may vary between your environment and mine.

I recommend, therefore, that we introduce OPEN-STREAM-P to detect whether a
stream is open, because I think we can agree on that much. I think we should
say that OPEN makes a stream which is open, that CLOSE closes a stream if
it's meaningful to do that -- we can probably define that for particular kinds
of streams, like file streams, that it really must do a close while leaving
anything we're unsure of undefined. OPEN-STREAM-P would not be a way to tell
whether CLOSE had been called, but rather whether open-stream operations were
permissible.

Having OPEN-STREAM-P, I think the appropriate compromise to satisfy both your
culture and mine is to say that calling INPUT-STREAM-P and OUTPUT-STREAM-P
on a closed stream will return an undefined value (actually, we can even say
that the value will be one of T or NIL -- but we cannot be more specific about
when it will be what, since we leave this up to an implementation). We should
make clear that the rationale is that there are different models of what 
closed stream direction is, which we have no reason to violate because in
practice there is no useful Common Lisp program which we anticipate being able
to write based on such a distinction given the existing primitives, and so
there's no reason to force implementations to gratuitously agree.

If this is acceptable, and you want me to draft it up, let me know.