[m-rev.] diff: fix .rt grade bug
Fergus Henderson
fjh at cs.mu.OZ.AU
Fri Feb 13 09:16:02 AEDT 2004
On 12-Feb-2004, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 12-Feb-2004, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > + rep = MR_type_ctor_rep(type_ctor_info);
> > + type_stat->type_ctor_reps[MR_GET_ENUM_VALUE(rep)]++;
>
> It would seem cleaner to put the MR_GET_ENUM_VALUE into the definition
> of MR_type_ctor_rep, not wrap it around all its uses.
There are about 20 uses of MR_type_ctor_rep in the Mercury runtime,
and only 3 of them need to use MR_GET_ENUM_VALUE(). It's only when
the enumeration value is used to index into an array that you need
MR_GET_ENUM_VALUE().
Putting MR_GET_ENUM_VALUE() into the definition of MR_type_ctor_rep
would mean that C code and Mercury code would use different
representations for type_ctor_reps, which would be more error-prone
than the current situation, IMHO. Also it would be a much more
invasive change.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list