[m-dev.] for review: improvements for record syntax

Ralph Becket rbeck at microsoft.com
Fri Dec 8 21:10:34 AEDT 2000


>From schachte at cs.mu.OZ.AU on 05/12/2000 23:44:32
> 	:- func elem(array, index) = int.
> 	:- func 'elem :='(array, index, int) = array.
> 
> or
> 
> 	:- func elem(index, array) = int.
> 	:- func 'elem :='(index, array, int) = array.
> 
> I guess the former look a bit better to me, so that puts me with Ralph
> and Fergus in preferring what I was calling policy (1a), but it's a
> fairly weak preference.

My main reason for preferring `X ^ f(Y, Z)  =  f(X, Y, Z)' was that it's
more convenient for higher order programming, viz

	map(elem(Dict), Xs)
vs	map(func(X) = Dict ^ elem(X), Xs)

By the way, I'm slightly unhappy about the name `elem'.  I'd prefer
something like the following:

	X = Map ^ value(Key)
and	Map ^ value(Key) := Y

--
Ralph Becket      |      MSR Cambridge      |      rbeck at microsoft.com 

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