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

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Dec 5 14:51:34 AEDT 2000


On 05-Dec-2000, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> Allow field access functions to take extra arguments.
> Change the field update function names from `'field:='/2' to `'field :='/2'

That looks good.

I do have one significant issue with this change, though: I don't
particularly like the order in which the transformation puts the
arguments.  In particular, IMHO would be more natural to make `A = A0
^ field(B, C) := D' compile to 'field :=' (A0, B, C, D, A) or perhaps
'field := '(B, C, D, A0, A), rather than to 'field :=' (B, C, A0, D, A)
as (I think) is the case with the diff that you posted.

For example, I think it would be more natural to transform
"Map = Map0 ^ elem(K) := V" to "'elem :=' (Map0, K, V, Map)",
not "'elem :=' (K, Map0, V, Map)",

I seem to remember this point coming up on the mailing list before,
with some rationale for the opposing viewpoint, namely that it
supports currying better.

However, you can always write "func(V) = X ^ elem(K) := V"
instead of "'elem :='(X, K)".

I guess this is mostly an aesthetic issue.  Any other opinions out there?

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