[m-rev.] for review: read and write bitmaps in bitmap.m

Julien Fischer jfischer at opturion.com
Sat Mar 5 19:10:07 AEDT 2022


Hi Zoltan,

On Sat, 5 Mar 2022, Zoltan Somogyi wrote:

> Read and write bitmaps in bitmap.m.
> 
> library/io.m:
>     Move the implementations of the predicates that read and write bitmaps
>     to bitmap.m. Leave forward predicates in io.m, but mark them obsolete.
>
>     Mark the predicates that get, set and update the globals structure
>     stored in the I/O state as obsolete.

That's a fairly significant change and should be mentioned in the head of the
log message as well.  (I have some reservations regarding
update_globals/3 that I mentioned in the other thread.)

>     Export some functionality used by the moved code. The exports are
>     in the second, undocumented interface section.
>
>     Improve the names of some internal predicates.
>
>     Add some module qualifiers to reduce type ambiguities.
> 
> library/Mercury.options:
>     Disable obsolete warnings for io.m, to allow the initialization
>     of the I/O state to initialize the globals as well; the globals
>     are now marked obsolete, but they do still exist.
> 
> library/bitmap.m:
>     Move the predicates for reading and writing bitmaps here from io.m.
>
>     Add a "_range" suffix to the names of the predicates that read and write
>     a range in a bitmap. Without this, both read_bitmap and write_bitmap
>     existed with *four* arities. Now each of these predicates has only
>     two arities: one with an explicit stream, and one without.
>
>     Document a spot that may need double maintance.
>
>     Move the hash functions before the predicates that do I/O.
> 
> NEWS:
>     Announce the changes.
> 
> library/bit_buffer.read.m:
>     Document a spot that may need double maintance.
>
>     Fix some comments, and indentation.
> 
> profiler/globals.m:
>     Use a mutable to replace the system's only remaining use of
>     the globals structure in the I/O state.
>
>     Stop exporting a predicate used only locally.
>
>     Delete unneeded module qualifiers on predicate declarations and
>     clause heads.

Has this change been checked in the C# and Java grades?  (If not, you
should do so to check that the access modifiers on the methods of the
underlying file stream implementations are still appropriate when the
bitmap code is in its new location -- it looks correct, but installing
the library in both of those grades will tell you definitively.)

I assume that some of the tests covering bitmaps will need to updated
at some point to remove calls to obsolete predicates.

Julien.


More information about the reviews mailing list