[m-rev.] diff: allow var-functor unifications for vars with inst `any'.

Fergus Henderson fjh at cs.mu.OZ.AU
Thu May 9 19:49:24 AEST 2002


On 09-May-2002, David Overton <dmo at cs.mu.OZ.AU> wrote:
> Allow var-functor unifications where the variable has inst `any'.
>
> compiler/inst_util.m:
> 	Handle `any' insts in abstractly_unify_inst_functor.

I don't think this is sufficient, since handling var-functor unifications
where the variable has inst `any' would require not just changes to the
mode analysis algorithm, but also changes to code generation, since the
current code generator doesn't know how to implement such unifications.

Unless you are assuming that any concrete type which has inst `any' must
actually be ground... I guess that could work, but if so, that assumption
should be clearly documented somewhere, including in particular the
places in mode analysis and/or code generation which rely on it.

> tests/valid/Mmakefile:
> tests/valid/any_functor_unify.m:
> 	Add a test case.

I would like to see a more substantial test, that was actually executed
(i.e. in the hard_coded or general directory, not in the valid directory),
so that it tests that the code generation is correct.
By more substantial I mean you should test several cases -- e.g.
discriminated union types, enumeration types, and atomic types
such as `int', not just no-tag types.

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