[m-dev.] for review: Aditi updates[3]

Simon Taylor stayl at cs.mu.OZ.AU
Thu Jul 1 12:05:25 AEST 1999


> 
> On 05-Jun-1999, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > +++ pd_util.m	1999/05/18 03:39:55
> [in pd_util__goals_match_2:]
> > @@ -933,12 +933,20 @@

> > +			% XXX we could do better matching the types and modes
> > +			% here.
> > +			OldGoal = generic_call(OldGenericCall, OldArgs1,
> > +					Modes, Det) - _,
> > +			NewGoal = generic_call(NewGenericCall, NewArgs1,
> > +					Modes, Det) - _,
> > +			functor(OldGenericCall, GenericCallType, _),
> > +			functor(NewGenericCall, GenericCallType, _),
> 
> I think this code is buggy, because the test using functor/3
> will consider all aditi_builtins to be equivalent.
> 
> In any case, functor/3 is not very efficient.  I think it would
> be better to write a match_generic_call predicate which handles
> each case separately.
> 
> Also, the comment here is not clear, IMHO --
> I think you should explain things in more detail.

The comment was slightly obsolete - the types are no longer present in
the goal. I've added the match_generic_call predicate and some more
documentation.

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