[m-dev.] Replacing pairs with 2-tuples

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 9 06:30:00 AEDT 2000


On 08-Nov-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> I was wondering whether it might be wise to consider migrating from
> the pair type to 2-tuples by changing to...
> 
> :- type pair(T1, T2) == {T1, T2}.
> 
> :- func T1 - T2 = pair(T1, T2).
> :- mode in - in = out is det.
> :- mode out - out = in is det.

I think that is a good idea.

But to improve backwards compatibility I'd suggest also defining these
modes:

	:- mode di - di = uo is det.
	:- mode uo - uo = di is det.

> We could mark -/2 as being deprecated and eventually do away with it
> altogether.

Sounds good to me.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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