[m-rev.] for review: clean up string.m

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Nov 10 13:39:25 AEDT 2014



On Mon, 10 Nov 2014 12:59:00 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
> I'll add the signbit implementation to the library later today.

Thanks.

> My suggestion would be that string.format (i.e. the pure subset of
> Mercury) should alway produce positive zero.  Users that care about negative
> zero (who are certainly in the minority) are already going to be forced
> to work in the impure subset of Mercury.  (Indeed, when the issues
> described at the top of the float module are finally fixed, they're
> going to be more forced to work in it.)

I just looked at float.m. I always knew we didn't fully implement
IEEE 754, but I didn't remember that things were this bad :-(

Yes, given all that, I agree that printing -0.0 as "0.0" is the right
thing to do. Any other opinions? (For me, it also means I don't
need the signbit test.)

> We should actually have a section in the reference manual that describes
> how Mercury aligns (or does not align) with the IEEE FP standard, not
> just a comment at the top of the float module.
> (I suspect I may have just volunteered to write it.)

Yep, you just have.
 
> > Done, though I have long thought that the NEWS file
> > would be more useful if it wasn't clogged with such minor
> > changes.
> 
> Library changes do need to be listed somewhere IMO.  We used to split
> the NEWS file into two sections, with summary at the top and then
> a detailed listing.  Perhaps, we should to that again?

I don't think the detailed listing is all that useful between releases,
because only developers tend to use rotds, and they see the additions
in mercury-reviews. The list of added library predicates/functions
in a release would be more likely to be correct if it was done just once,
when the release is prepared, and not piecemeal, because it could
be done semi-automatically, using the debugger command that
lists all the procedures in program. Just create a program that
imports all the library modules, compile it while disabling the deletion
of unused procedures, and voila, a complete list of the procedures
in the standard library. Do this with the current and the previous
release, and take the diff.

Zoltan.




More information about the reviews mailing list