[m-dev.] for review: merge HAL branch onto main branch

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Feb 19 15:30:44 AEDT 2001


On 19-Feb-2001, David Jeffery <dgj at cs.mu.OZ.AU> wrote:
> On 15-Feb-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > > +
> > > +        % Output a `dummy' ptag layout, for use by tags that aren't *real*
> > > +        % tags, such as the tag reserved when --reserve-tag is on.
> > > +:- pred output_dummy_ptag_layout_defns(io__state::di, io__state::uo) is det.
> > > +
> > > +output_dummy_ptag_layout_defns -->
> > > +        io__write_string("\t{ 0, MR_SECTAG_NONE, NULL },\n").
> > 
> > Hmm... there's lots of code in the Mercury runtime system which won't
> > work with such a dummy ptag layout.
> > 
> > What were you planning on doing about that?
> > 
> > I think that warrants at least an XXX comment.
> 
> I'm not sure what you're getting at here...

Well, I was thinking about the code for unify, compare, deep_copy,
deconstruct, etc.

> perhaps I need to add the following to the comment?:
> 	% This dummy layout should never actually be referenced; the ptag that
> 	% this layout refers to should never actually be used by Mercury.
> 
> Does that make it clearer?

That helps a bit, but not quite enough... if it is used at all,
what ensures that it won't be used by Mercury?  It would help to
explain why unify, compare, deep_copy, deconstruct etc. won't be
called for values which use the reserved tag.  (Now that I think
about it in a bit more detail, I think I can guess at what the reason
might be... but I think it is worth documenting.)

Another possible alternative would be to give the dummy layout a value
that Mercury won't crash with, e.g. something that says that this
value is a c_pointer.

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