[mercury-users] string_stream impl, re: redirecting output to streams

Julien Fischer juliensf at cs.mu.OZ.AU
Fri Feb 17 20:59:19 AEDT 2006


On Fri, 17 Feb 2006, Ian MacLarty wrote:

> > >
> > > 4.  implement other useful streams such as string buffers, sockets, etc.
> >
> > I'd like to get this proposal sorted and implemented because reading terms
> > from strings has just become an issue with the compiler.
>
> How so?
>

With the intermodule-analysis framework, we store what is basically the
contents of the .opt files in the .analysis files as strings.  The code
in the frontend of the compiler uses the term_io module to read this in,
which at the moment means we need to write the strings back out to a
temporary file and then read them back in.

(Eventually, we'll most probably have to rewrite quite a bit of the frontend
of the compiler to handle this a bit better; our problem at the moment is that
we're trying to reuse the machinary for handling .opt files with the analysis
framework.)

> > Some other details
> > with the streams proposla that need to be ironed out:
> >
> > - duplex streams
> > 	- extras/streams includes these; is there a reason they were
> > 	  omitted from your proposal?
> >
>
> No.
>
> > - buffered vs. unbuffered streams
>
> Perhaps we can just define a `buffer' stream, that connects two other
> streams.  I don't see the need for a separate typeclass.
>

I was thinking along the lines that a member of the buffer typeclass might add
a flush method.

Julien.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list