[m-rev.] for review: bit buffers

Ian MacLarty maclarty at csse.unimelb.edu.au
Tue May 15 10:37:26 AEST 2007


On Mon, May 14, 2007 at 04:17:12PM +1000, Simon Taylor wrote:
> 
> 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.
> 
> 	Clarify the blocking behaviour of `put' and `get'.
> 
> 	Document the behaviour of subsequent calls to `get'
> 	after a call returns eof or an error.
> 

Can you explain why you have created a new typeclass and not used the existing
stream typeclasses?  It should be possible to create a buffered bit stream
using a mutvar attached to the stream state.

One of the motivating reasons for parameterising readers and writers over the
unit type was so that both text and binary streams could be handled using the
same typeclass.  If you define a new typeclass, then some reuse potential is
lost (for example you cannot use stream.input_stream_fold).

Ian.
--------------------------------------------------------------------------
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