[m-dev.] for review: stream I/O
Michael Day
mcda at students.cs.mu.oz.au
Mon Oct 9 12:34:51 AEDT 2000
> :- mode with_stream(pred(out, di, uo) is det, out, di, uo) is det.
> with_stream(Pred, Result, S0, S) -->
> stream__init(S0, Stream0),
> { Pred(Result, Stream0, Stream) },
> stream__destroy(Stream, S).
Hmm wouldn't it be necessary to pass the io__state through to the
predicate as well as the stream, so that it can open new streams itself
and perform other io? Otherwise doesn't it restrict you to only opening
one stream at a time?
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