[m-rev.] for review: automatically generate all type_ctor_infos on non C backends

Peter Ross pro at missioncriticalit.com
Fri Nov 21 06:32:03 AEDT 2003


On Fri, Nov 21, 2003 at 01:35:05AM +1100, Simon Taylor wrote:
> On 20-Nov-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> > It isn't wrong, there is always a unification predicate generated but is
> > that predicate generated by unify_proc or defined out-of-line in C#?
> > 
> > This bit of code tests is there an implementation in Mercury for the
> > unification and comparison predicates for these types?
> > 
> > As there is no private_builtin.builtin_unify_func the Mercury compiler
> > generates a call to mercury.builtin.special__Unify__func_0_0 which then
> > calls mercury.builtin.special__Unify__func_0_0, where this deep magic
> > occurs I am not sure.
> > 
> > However there is a mercury predicate builtin_unify_pred which unifies
> > pred so in that case we generate for the Unify predicate for pred/0
> > (maybe the name is wrong, but that is what we had before in the code)
> > which simply calls private_builtin.builtin_unify_pred.
> > 
> > Look in add_special_preds in make_hlds.m to see the two different cases
> > for adding the special_pred explained above.
> > 
> > Does this help?
> 
> It suggests that your code works in non-obvious ways. 
> The lack of a case for `tuple' in the switch on TypeCtor is also
> suspicious.  The RTTI for pred/0, func/0 and tuple/0 should all be
> implemented the same way.
> 
Agreed it does work in non-obvious ways and the ideal solution would be
to implement all the builtin types as foreign types, then all of these
issues would disappear.

I will look into making as many as possible of the builtin types have
their special preds implemented in Mercury, when I have the time.
--------------------------------------------------------------------------
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