[mercury-users] Pred defns

Andrew Bromage bromage at cs.mu.OZ.AU
Tue Mar 31 11:04:05 AEST 1998


G'day.

Fergus Henderson wrote:

> But my main criticism is that I think making it easier to add hidden
> arguments in this way often this comes at the expense of making the
> modified code harder to read.  Because the arguments are hidden, it is
> harder to understand the program's data flow.

It's not just easier to write, it's also easier to maintain (if you
already understand the code, of course).

I take your point about the "harder to read" problem.  I think what
we need is a hybrid suggestion.  You want the arguments to be shown
at each call (as per your new suggestion), but you also want the
compiler to supply the argument ordering for these "extra" arguments
for you (as per EDGCs), that is, you want to declare the extra
arguments but _not_ give them a position within the arguments to
the call itself.

Perhaps what we're really after is a variation on named arguments for
predicates which also handles accumulator pairs.

Cheers,
Andrew Bromage



More information about the users mailing list