[m-dev.] Type info convention

Simon Taylor stayl at cs.mu.OZ.AU
Sun Nov 19 00:44:06 AEDT 2000


Fergus wrote:
> On 17-Nov-2000, Peter Ross <peter.ross at miscrit.be> wrote:
> > The work done by Simon on the type spec change causes a few problems for
> > structure reuse.  This is because type_info's are a `hidden' type, ie
> > they don't appear in mode declarations. 
 
 ...
 
> > Simons latest changes places
> > some new type infos at the end of the headvars, making it very hard to
> > determine which headvars are `real'.
> 
> Could you be more specific?  Which change of Simon's?
> Have you got a simple example program which demonstrates this?

I think Peter means the change which added `:- pragma type_spec'
declarations to the library. For a specialization
`:- pragma type_spec(p/1, T = var(V))', a type-info for `V' needs
to be added to the argument list. higher_order.m adds that argument
to the end of the list.

Procedures created by deforestation will cause the same problems.
Deforestation works out the order of the arguments of procedures
it creates by calling `set__to_sorted_list' on the non-locals of a goal.

> > Simon would it be possible to change this so that the type infos are
> > placed at the head of the list?  How much work would it be?
> > 
> > I think we should obey the convention that any head var which doesn't
> > have an explicit mode declaration should go at the start of the
> > headvars.
> 
> That might be reasonable.

Code which relies on the argument order of specialized procedures
is not very robust. Structure reuse should be fixed.

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