[m-dev.] for review: RTTI for existential types

David Glen JEFFERY dgj at cs.mu.OZ.AU
Wed Nov 24 18:21:03 AEDT 1999


On 24-Nov-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > --- base_type_layout.m	1999/07/13 08:52:40	1.46
> > +++ base_type_layout.m	1999/11/24 04:54:41
> ...
> > @@ -1183,6 +1379,8 @@
> >  :- pred base_type_layout__remove_create(rval, maybe(rval)).
> >  :- mode base_type_layout__remove_create(in, out) is det.
> >  
> > +:- import_module exception.
> > +
> 
> I think that import is unused.

Well... there was a throw just above it in the diff, but arguably I should
just make the throw into a call to `error'. I was using throw because I was
throwing a bunch of things, including an error message and the offending
arguments that cause the exception.

> > +/* XXX Do I need to change MR_make_type_info too? As far as I can tell,
> > + * MR_make_type_info is never called on arguments of constructors, but I don't
> > + * know whether that is by design or not... Tyse? Fergus? */
> 
> Yes, I think you do.  In particular, MR_make_type_info() gets called
> to construct the type_info for a constructor argument in copy_arg()
> in runtime/mercury_deep_copy_body.h.
> 
> You should add a test case that tests calling deep_copy on existentially
> quantified data types.

Will do.

> > +                        /* Maybe we need to thread the value */
> > +                        /* down as well... */
> >                  equiv_type_info = (Word) MR_create_type_info(
> >                                  (Word *) maybe_equiv_type_info, 
> >                                  (Word *) equiv_type_info);
> 
> Hmm... I'm not sure about that one.

I meant to delete that comment... I'm pretty sure that code is correct (or
at least `correctish' ;-) now.


dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) | If your thesis is utterly vacuous
PhD student,                    | Use first-order predicate calculus.
Dept. of Comp. Sci. & Soft. Eng.|     With sufficient formality
The University of Melbourne     |     The sheerist banality
Australia                       | Will be hailed by the critics: "Miraculous!"
                                |     -- Anon.
--------------------------------------------------------------------------
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