[mercury-users] Pred defns
Andrew Bromage
bromage at cs.mu.OZ.AU
Sat Apr 4 11:30:57 AEST 1998
G'day all.
Dominique de Waleffe wrote:
> Really, I want to :
> - use more than 1 accumulator,
> - escape from passing all of them around to all subgoals,
> - be able to reference next and current state by name
> - have preference for local effects/transformations
I think it would help everyone if we put our requirements on the table
rather than concrete proposals. That way, we can design a system based
on what people want rather than (potentially) ugly syntax.
I want to:
- Be able to pass variables "in", "out" and "through" a call,
the last of the three corresponding to an accumulator pair.
- Be able to reference the next and current state of each variable
by name.
- Require declarations (at the :- pred declaration) of what
named variables will be passed in, out and through.
- Require declarations at each call of what named variables
will be passed in, out and through (i.e. no hidden arguments
because that was the problem with EDCGs).
- Not have to pick an argument position in each call of where
the named variables "go". This is the major benefit of EDGCs.
BTW, I like the sound of "registers" on a module-by-module basis, though
not at the source level. Perhaps a unique passed-in variable or a
destructively updated accumulator could be a hint to the compiler to
try inferring this.
Cheers,
Andrew Bromage
More information about the users
mailing list