[m-dev.] Re: Visual vs total arity clash example [fwd]

Peter Nicholas MALKIN pnmalk at students.cs.mu.oz.au
Fri Jan 28 12:09:57 AEDT 2000


Hi,

On Thu, 27 Jan 2000, Fergus Henderson wrote:

> > ****************** Old Code **************************************************
> > 
> > 	% app_all appends two lists onto the front of another list.
> > :- pred app_all(list(char), list(char), list(char), list(char)).
> > :- mode app_all(in, in, in, out) is det.
> > 
> > app_all(Cs1, Cs2, L0, L2) :-
> > 	app(Cs2, L0, L1),	% This is an ambiguity error
> > 	app(Cs1, L1, L2).	% This is an ambiguity error
> >
> > :- pred app(list(char), list(char), list(char)).
> > :- mode app(in, in, out) is det.
> > 
> > app([], L0, L1).
> > app([C | Cs], L0, L2) :-
> >         app(Cs, L0, L1),	% This is an ambiguity error
> >         L2 = [C | L1].
> 
> You lost me here.  Why are those three calls to app/3 ambiguity errors?

Sorry if it was unclear, but I meant an ambiguity error when adding the new
code with the old code and not that the new code replaces the old. So a call to
app/3 is an ambiguity error because the old code has app/3 (visual arity) AND
the new code has app/3 (total arity).

Peter

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