[m-dev.] for review: allow multiple clauses in instance decls

Simon Taylor stayl at cs.mu.OZ.AU
Wed Sep 20 14:24:07 AEDT 2000


> Hi Simon,
> 
> On 20-Sep-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > +++ compiler/check_typeclass.m	2000/09/19 13:41:29
> ...
> >  		%
> >  		% Make sure the list of instance methods is in the same
> >  		% order as the methods in the class definition. intermod.m
> > -		% relies on this. If there were errors, don't change the
> > -		% list of methods.
> > -		%
> > -		(
> > -			list__length(RevInstanceMethods,
> > -				list__length(InstanceMethods))
> > -		->	
> > -			OrderedInstanceMethods =
> > -				list__reverse(RevInstanceMethods)
> > -		;
> > -			OrderedInstanceMethods = InstanceMethods
> > -		),
> > -			
> > +		% relies on this
> > +		OrderedInstanceMethods = list__reverse(RevInstanceMethods),
> > +
> 
> Is that change going to break anything?  What's the rationale for not
> changing the list of methods if there weren't any errors?

It should be fine -- only intermod.m looks at this field after
check_typeclass, and it won't be run if there were errors. I just
thought it was better not to throw away bits of the declared instance
interface if there were errors.

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