[m-dev.] for discussion: stream library v2
Fergus Henderson
fjh at cs.mu.OZ.AU
Fri Sep 29 21:15:20 AEDT 2000
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.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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