[m-rev.] field syntax (was: smart recompilation)

Ralph Becket rbeck at microsoft.com
Fri Jul 6 19:43:30 AEST 2001


> From: Peter Schachte [mailto:schachte at cs.mu.OZ.AU]
> Sent: 06 July 2001 03:08
> 
> 	:- property position ^ r = float.
> 
> 	position(X,Y) ^ r = sqrt(X*X + Y*Y).
> 
> 	(position(X,Y) ^ r = R) = position(X*Factor,Y*Factor) :-
> 		Factor = R / sqrt(X*X + Y*Y).
> 
> This seems much cleaner and more intititive to me than incorporating
funny
> naming conventions into the Mercury language standard.
> 
> If we do that, then we can choose to allow the property name to be
used as
> an ordinary function if we like.  Ie, Mercury can allow
> 
> 	Radius = r(Pos)
> 
> if we like.  More importantly, it can allow
> 
> 	map(r, Positions, Radii)

I rather like this proposition.

I would also like to see a reverse application operator: it really
can make code more readable.

- Ralph
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list