[m-dev.] for review: stream I/O

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Oct 3 20:48:08 AEDT 2000


On 03-Oct-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> 
> The with_stream approach, which I definitely think we should
> include, has the drawback that one has to know the exact
> lifetime of a stream so one can enclose it in the scope of a
> with_stream.  This isn't always going to be the case, so some
> more general mechanism is also required.

Well, if you don't know the scope of the stream, I think it should
always be possible to write your program in continuation-passing
style, so that if necessary all the code between the point where
the stream is opened and the end of `main' ends up being inside
the scope of the `with_stream'.  This won't necessarily be convenient,
but I think it should be possible...

Do you have any good examples of cases where you won't know the
lifetime of the stream?

-- 
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