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

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Dec 21 00:11:09 AEDT 2006


On Wed, 20 Dec 2006, Simon Taylor wrote:

> On 20-Dec-2006, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>>
>> On Wed, 20 Dec 2006, Simon Taylor wrote:
>>> This might be overkill, it might be better just to have:
>>>
>>> stream.m
>>>   stream.char.m		write, format, read, read_line, etc.
>>>   stream.byte.m		write_binary, read_binary, etc.
>>
>> I prefer the latter suggestion, although if the distinction is going
>> to be between text and binary streams then the sub-module names ought
>> to reflect that, e.g.
>>
>> 	stream.m		[all the typeclasses]
>> 	stream.text.m		write, format, read, read_line, etc.
>> 	stream.binary.m		write, read, etc.
>
> The names I gave already give that distinction clearly. stream.char.m
> deals with streams of characters. stream.byte.m deals with streams of
> bytes. This sets up a naming convention (stream.<type>.m) if we ever
> want to create modules to deal with other types of streams.

I don't like the idea of a sub-module having the same (unqualified) name as
another standard library module.  Neither does the compiler apparently (see
below **).

You might as well go with stream.string_writer; none of the alternatives
have been particularly appealing.

Julien.

** the following is a bug, presumably in the code that generates
    the dependencies, although I haven't looked that closely.

 	:- module foo.
 	:- interface.
 	:- include_module foo.
 	:- end_module foo.

 	:- module foo.char.
 	:- interface.
 	:- pred bar(int::in) is semidet.
 	:- implementation.
 	bar(561).
 	:- end_module foo.char.

mmc --make foo or mmake foo.depend both go into a loop with the
above modules.
--------------------------------------------------------------------------
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