[mercury-users] Another Mercury Modes Problem
Ralph Becket
rafe at cs.mu.OZ.AU
Tue May 28 16:45:12 AEST 2002
David Overton, Tuesday, 28 May 2002:
> On Tue, May 28, 2002 at 03:01:07PM +1000, Ralph Becket wrote:
> >
> > % These should be built-in, but aren't...
> > %
> > :- mode di(I) == unique(I) >> dead.
> > :- mode uo(I) == free >> unique(I).
>
> The inst `unique(...)' takes a list of functors separated by `;' (the same
> as `bound(...)'), not an inst.
I was unsure of that syntax. How does one apply the unique attribute to
a named inst?
> `di/1' is defined in builtin.m as
>
> :- mode di(I) == (I >> dead).
>
> `uo/1' is not defined, but it would be the same as `out/1' if it were.
This would appear to require that every inst come in both shared and
unique flavours, rather than being able to apply the unique attribute to
the top-level functor at will.
Which reminds me of a discussion I was having with Fergus: Fergus tells
me that uniqueness goes "all the way down" and that this is what one
typically wants. I can't see it, myself: I agree that one often wants a
unique "spine", but the other arguments to a functor needn't (won't) be
unique in the common case, as far as the examples I've been able to come
up with are concerned. Would it cause major problems if uniqueness only
applied to the functor, rather than recursively to all its arguments as
well?
- Ralph
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list