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

Re: Last call

On 30/06/2013 19:19, Per Bothner wrote:
> No, the issue is not Java, but what a "port" conceptually is
> (or should be): A "port" is a sequence of values, along with a current
> position in that sequence.  An "input/output port" is not a sequence -
> it is two sequences, along with two positions.
Probably (or most definitely) I have different opinion about this so I simply don't understand the point. Here is my understanding and objection break down;

* If a "port" is a sequence, then it can be represented by a list (say list-port)
 * "list-port" has a position.
 * When reader reads from "list-port", then the position will be increased.
* Then writer writes (in this case appends) to "list-port", it writes after the above position.
 * Position change operation changes the position.

In R6RS, if you want to get the last position of port without using implementation dependent procedures, you need to read everything first then call 'port-position' whichever port type is. Hence the port has only one position. (I think this is inconvenient, though.)

This might not be the case for a "socket port" so that socket has real bidirectional IO.

Takashi Kato
E-mail: ktakashi@xxxxxxxxx