[m-rev.] for review: bit buffers

Julien Fischer juliensf at csse.unimelb.edu.au
Tue May 29 14:55:47 AEST 2007


On Mon, 28 May 2007, Simon Taylor wrote:

> The stream.bulk_writer class has been removed.
>
> The interface to bit_buffer.read has been changed to match the
> stream.bulk_reader class.
>
> stream.bulk_get now returns `ok' or `error(...)', but not `eof'.
> I did this because it was unclear what a result of `ok' on a read
> returning less than the number of units requested read would mean.
> `eof' was expressed both in the `stream.result' and in the returned
> number of units read.  I also removed error checking from
> bit_buffer.read.m that really belongs in the user of the read_buffer.

...

> Estimated hours taken: 90
> Branches: main
>
> NEWS:
> library/bit_buffer.m:
> library/bit_buffer.read.m:
> library/bit_buffer.write.m:
> 	Add bit_buffers to the standard library.  A bit_buffer
> 	provides a bit-oriented interface to byte streams.
> 	These will be used as a base for write_binary and read_binary.
>
> library/stream.m:
> 	Add classes bulk_writer and bulk_reader, which support
> 	reading and writing multiple items at once into a store.

The log message for stream.m need updating.

> 	Clarify the blocking behaviour of `put' and `get'.
>
> 	Document the behaviour of subsequent calls to `get'
> 	after a call returns eof or an error.
>
> library/bitmap.m:
> 	Add a shorthand for `new(N, no)'.
>
> 	Add `shrink_without_copying' to destructively shrink a bitmap
> 	without copying the data.
>
> 	Add a function `append_list' to condense a list of bitmaps.
>
> 	Improve bounds error messages.
>
> 	Clean up the handling of zero-length bit ranges.
>
> 	Add type `bitmap.slice' to represent a segment of a bitmap,
> 	and functions to create slices.
>
> library/io.m:
> 	Change the interface of io.read_bitmap to conform to
> 	the stream.bulk_reader interface, by not returning the
> 	bitmap inside the return code.  The bitmap is still
> 	valid (although maybe not completely filled) no matter
> 	what result is returned.
>
> 	Add io.read_binary_file_as_bitmap/N.
>
> library/library.m:
> 	Add recent additions to the list of library modules.
>
> library/Mercury.options:
> 	Use "+=" rather than "=" when setting target-specific
> 	options to allow them to be added to be Mmake.params.
>
> tests/hard_coded/Mmakefile:
> tests/hard_coded/bit_buffer_test.m:
> tests/hard_coded/bit_buffer_test.exp:
> 	Test case.
>
> tests/hard_coded/bitmap_test.m:
> tests/hard_coded/bitmap_simple.m:
> tests/hard_coded/bitmap_test.exp:
> 	Update for change to io.read_bitmap.
>
> 	Test bounds error messages.
>

The rest of the diff looks okay.

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