[m-rev.] diff: workaround to fix nightly builds

Mark Brown mark at cs.mu.OZ.AU
Tue Aug 16 02:59:32 AEST 2005


On 16-Aug-2005, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
> 
> On Mon, 15 Aug 2005, Mark Brown wrote:
> > +	% A "renaming" is a map where the keys and values have the
> > +	% same type.
> > +	%
> > +:- type renaming(T) == map(T, T).
> > +
> > +	% Follow a chain of renamed elements until we find one that is
> > +	% not renamed.
> > +	%
> > +:- func map__search_transitively(renaming(T), T) = T.
> > +:- pred map__search_transitively(renaming(T)::in, T::in, T::out) is det.
> > +
> > +	% Collapse a recursive renaming into a non-recursive one.
> > +	%
> > +:- func map__transitive_closure(renaming(T)) = renaming(T).
> > +:- pred map__transitive_closure(renaming(T)::in, renaming(T)::out) is det.
> > +
> 
> I think it would be better if the names of those two predicates somehow
> reflected the fact they deal with renamings rather than maps in general.
> (Perhaps we should make renaming a submodule of map?)

(I didn't notice this comment first time around.)

Possibly.  But the fact that they both include the word "transitive" implies
that the keys and values must have the same type, otherwise it doesn't
make sense.

As to where the code belongs, I'm not sure.  But renamings are used
throughout the compiler, so I think it would be good to define them
specifically somewhere, preferably in the standard library.

Cheers,
Mark.

--------------------------------------------------------------------------
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