[m-dev.] for discussion: stream library v2

Peter Ross peter.ross at miscrit.be
Fri Sep 29 23:51:49 AEDT 2000


On Fri, Sep 29, 2000 at 09:15:20PM +1100, Fergus Henderson wrote:
> On 28-Sep-2000, Peter Ross <petdr at miscrit.be> wrote:
> > > > 	% The state of the world for one stream of type S.
> > > > :- type stream(S).
> > > 
> > > The comment here is not clear; what do you mean
> > > "the state of the world for one stream"?
> > > Do you just mean "the state of a stream"?
> > > 
> > Yes it is meant to represent the state of the stream.
> 
> OK, then please say that ;-)
> 
> > > > :- type stream(S)
> > > > 	--->	stream(
> > > > 			S,		% Handle on the stream
> > > > 			list(char)	% Putback characters
> > > > 		).
> > > 
> > > The comment here is also confusing; is `S' a handle to the stream,
> > > or is `S' the stream state (excluding putback chars)?
> > > 
> > > Normally "handle" is used to mean an abstract kind of pointer or
> > > reference.  A "handle" would not need to be uniquely moded, in
> > > general, since you modify what the handle refers to, rather than the
> > > handle itself.
> > > 
> > It is a bit of both.  It is used in a state like manner by the high
> > level interface, but it will also be needed to be used as a handle when
> > closing streams and such like.  See my message 
> > http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-users/mercury-users.0009/0003.html
> > for a reason why you need a non unique handle on a stream.
> 
> The stream state can include the handle.
> But the stream state must contain other stuff than just the handle.
> It must contain something representing the external state which
> gets modified when you write to the stream.
> 
> Here I think `S' should be the stream state.  So I think the comment
> there saying that it is the handle should be changed.
> 
I understand the reasoning why the stream must contain something this is
modified, unfortunately you cannot guarantee that S will be changing.  I
will add a c_pointer field and update the documentation.

Pete
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list