[m-dev.] for review: improvements for record syntax
Ralph Becket
rbeck at microsoft.com
Sun Dec 10 04:12:04 AEDT 2000
> From: Simon Taylor [mailto:stayl at cs.mu.OZ.AU]
> > So far we have:
> > policy (1) where X ^ f(Y, Z) is sugar for f(X, Y, Z) and
> > policy (2) where X ^ f(Y, Z) is sugar for f(Y, Z, X)
> >
> > The `horridness' associated with (1) is based on a false premise,
> > namely that
> > > So `Y = f(A), X ^ Y' means `Y = f(A), Y(X)', i.e.
> `f(A)(X)' or `f(A, X)',
> > > not `f(X, A)'.
> > In the first place, Y = f(A), X ^ Y should expand to
> f(A)(X), *not* f(A, X).
>
> Why are they not equivalent?
I was thinking along the following lines: f(A)(X) applies f to A
and applies the result of that to X, which is different to f(A, X) which
constructs a closure for f with the first two arguments bound to A and
X (and maybe evaluates that).
I was worried about the case where we had functions f/1 and f/2, but
in that case Y = f(A), X ^ Y leads to an ambiguity error regardless of
the ^ transformation.
Having thought a bit more about it, I've come to the conclusion
that you're right: it makes no difference wrt the ^ transformation.
I therefore withdraw my objections to the scheme :)
Ralph
--------------------------------------------------------------------------
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