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

Michael Day mcda at students.cs.mu.oz.au
Wed Sep 27 12:56:52 AEDT 2000


> > > >     * you have a non-unique handle on a stream which means that you can
> > > >       still process that stream after an exception.
> > > 
> > > Is it really not possible to achieve this by some extension of try_io:
> > > 
> > > :- pred try_io(pred(T, S, S), exception_result(T), S, S) <= stream(S).
> >
> > I am not sure.  Maybe Fergus can answer.
> 
> I don't see any problem with Michael's suggestion.

In that case, is a non-unique stream handle still necessary for all the
stream interfaces? Which is less ugly: having to pass around more
parameters (or possibly not, given Peter's latest suggestion) or having to
use some hacked up alternative to the standard try?

Which makes me wonder... what happens if you pass in an io__state to the
normal try rather than try_io, someone throws an exception and you lose
your io__state. I guess that would not compile, as you would have nothing
left to return from main?

Michael


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