[m-dev.] for review: use bitsets in quantification

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 8 15:24:44 AEDT 2000


On 03-Nov-2000, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> +	% Used by floor_to_multiple_of_bits_per_int, placed
> +	% here to make sure they go in the `.opt' file.
> +:- func int__div_bits_per_int(int) = int.
...
> +:- pragma c_code(int__div_bits_per_int(Int::in) = (Div::out),
> +		[will_not_call_mercury, thread_safe], "
> +	Div = Int / ML_BITS_PER_INT;
> +").

I think that should be named something different, e.g.
`int__quot_bits_per_int', since it corresponds to `//',
not to `div': it returns

	Int // bits_per_int

not

	Int `div` bits_per_int.

It would also help to document what it does, e.g.

		% int__quot_bits_per_int(X) = X // int__bits_per_int.
	:- func int__quot_bits_per_int(int) = int.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list