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

Re: ports (really disjointness of types)



>     why...are [ports] somehow kept out of the "disjointness of types" ??
> 
> Without answering this question, does anyone know whether there
> might be any significant benefit to allowing the set of input ports
> to overlap with the set of output ports?  I am aware of claims that
> this is useful, but I'd like to understand why.  (I am not impressed
> by the convenience of packaging two ports within a single object,
> which is the only explanation I have heard.)

This may be simply a question of convenience, but it would seem strange
to me that I would need two ports for one file that is open for both
reading and writing.  Certainly it would seem strange as well as
inefficient to have to seek to a given record on both ports in order to
modify the record.  And it may be difficult to totally separate the
input and output ports for a read/write file opened "exclusively", or
there may be an efficiency penalty for doing so.

I'll turn the question around.  Does anyone know whether there might be
any significant benefit to not allowing the set of input ports to
overlap the set of output ports?  I almost never use input-port? except
to check to see if I can read from a port before doing so, and I could
not care less if it were also valid to write to the port in that
context.  If we're going to make a restriction that might possibly make
someone's fancy I/O interface clumsy or inefficient, we should have a
very good reason for doing so.

Kent