[m-rev.] for review: fix testing of `ground' matches `bound'
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Jul 14 16:56:08 AEST 2003
On 14-Jul-2003, David Overton <dmo at cs.mu.OZ.AU> wrote:
> On Tue, Jul 08, 2003 at 04:46:30PM +1000, Fergus Henderson wrote:
> > On 08-Jul-2003, David Overton <dmo at cs.mu.OZ.AU> wrote:
> > > compiler/modules.m:
> > > When writing discriminated union types to the .int2 file, write
> > > out the full type definition rather than an abstract type
> > > declaration.
> >
> > Won't that cause problems for types with user-defined equality or
> > comparison procedures? The .int2 file would then contain a reference
> > to a procedure which had not been declared.
>
> What is the best way to handle this?
Good question. I'm not sure.
But whichever way is used, there should be some test cases to test this.
Also, the documentation at the top of modules.m should be updated to
explain whichever approach is taken. For example the current statement
in modules.m that "the .int2 file is just a fully qualified version of
the .int3 file." would no longer be true after you change.
> Should I just ensure that the
> user-defined equality/comparison annotation does not appear on the type?
Hmm. I don't think that would be a good idea, because then the type
would appear to be a canonical type, but in fact it would actually be
a non-canonical type. This has consequences for determinism analysis
(and potentially other consequences if/when we try to evaluate RTTI calls
at compile time). In particular, determinism analysis of procedures
in .opt files that happen to deconstruct such types might infer the wrong
determinism if the type is thought to be canonical when it isn't.
Perhaps we could use some special syntax in `.int2' files which
indicates that a type has user-defined equality or comparison,
without specifying the equality or comparison predicate?
--
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