> On 13 Nov 2017, at 20:27 , Sven Van Caekenberghe <s...@stfx.eu> wrote:
> 
> There is a discussion about positioning (#position , #position: and related) 
> but these cannot be supported _in general_ by the kind of streams described 
> above.

I agree with that.  But I think that general streams can, and should support:

        # saveState     “answers an opaque cookie” 
        # restoreState: aCookieObtainedFromTheSameStream

This enables pone to read ahead, and then reset the state to the way that it 
was.  The implementation of the cookie will depend on the implementation of the 
stream.  In the simplest case it may be an integer position (sufficient for an 
in-core stream); in the more general case it may include a copy of the stream’s 
buffer, and the cookie obtained by saving the state of any wrapped stream.

        Andrew

Reply via email to