[m-dev.] for review: correct aliasing in args of compiler generated procedures

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Oct 9 19:29:39 AEST 1999


On 08-Oct-1999, David Overton <dmo at cs.mu.OZ.AU> wrote:
uniq_count.m:
> +:- pred has_count_many(uniq_counts(T), T).
> +:- mode has_count_many(in, in) is semidet.
...
> +has_count_many(Map, Item) :-
> +	map__search(Map, Item, Count),
> +	( Count = known(N), N > 1
> +	; Count = many
> +	).

The name of that predicate is misleading.
It should be renamed `has_count_greater_than_one', IMHO.
Or alternatively it should at least be clearly documented. 
(But I think renaming it would be best.)

> +:- pred uniq_counts_max_merge(uniq_counts(T), uniq_counts(T), uniq_counts(T)).
> +:- mode uniq_counts_max_merge(in, in, out) is det.

That predicate should be documented, since it is not clear from the name
exactly what it does.

(I know you only moved that code into a new module, rather than wrote it,
but it would still be nice if you could fix those two.)

Also the uniq_count module should be documented in
notes/compiler_design.html.

Apart from that, that change looks fine.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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