[m-rev.] for review: io.write for streams

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Dec 19 17:20:58 AEDT 2006


On Fri, 15 Dec 2006, Simon Taylor wrote:

> Implement io.write for arbitrary streams.  With type specialization
> this is only slightly slower than the original.
>
> library/stream.string_writer.m:
> 	A module containing predicates for writing to streams
> 	which accept strings.

Is there a reason that you are putting these predicates in a sub-module of
stream.m rather than just in stream.m itself?  Also, I'm not crazy about the
name string_writer, it sounds like a set of predicates for contructing
strings.  At the moment, I guess my preference would be to just add
everything to stream.m.

(The long term plan is that the stream.m should just define the stream
typeclasses and all the utility predicates that currently live in that
module should find home elsewhere.)

> library/stream.m:
> 	Move stream.format to stream.string_writer.m.

The predicate is_format_call/5 in compiler/format_call.m will also
need to be updated.

> 	Add stream.put_list, which is like io.write_list.
>
> library/io.m:
> 	Move io.write and io.print to stream.string_writer.m.
>
> library/term_io.m:
> 	Add stream versions of predicates used by io.write.
>
> library/ops.m:
> 	Move io.adjust_priority_for_assoc to here (private
> 	predicate used only by library modules).
>
> 	Export ops.mercury_max_priority for use by
> 	stream.string_writer.write.
>
> Mmake.common.in:
> compiler/modules.m:
> compiler/mlds.m:
> compiler/mlds_to_c.m:
> compiler/mlds_to_java.m:
> compiler/mlds_to_managed.m:
> compiler/prog_util.m:
> 	Allow sub-modules in the standard library.

There may also be some code in mdbcomp/prim_data.m that needs updating.

> compiler/polymorphism.m:
> 	Fix a bug which caused tests/hard_coded/print_stream.m to
> 	fail with this change.  The wrong argument type_info would
> 	be extracted from a typeclass_info if the constraints of the
> 	typeclass-info were not all variables.
>
> browser/browse.m:
> tests/hard_coded/stream_format.m:
> tests/hard_coded/test_injection.m:
> tests/invalid/string_format_bad.m:
> tests/invalid/string_format_unknown.m:
> 	Updated for predicates moving between library modules.

(The NEWS file will also need updating but there's no point doing that
until the original announcment of stream module is committed.)

That looks good otherwise.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list