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

Simon Taylor stayl at cs.mu.OZ.AU
Tue Jul 3 15:58:29 AEST 2001


On 03-Jul-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 23-Jun-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > `Object ^ Field' is just a synonym for `Field(Object)'. I think the
> > only argument was that the `Object ^ Field' syntax was a bit redundant.
> 
> Can I add the note that the redundancy also makes it very explicit.
> 
> Field(Object) is pretty difficult to tell apart from NotField(Object),
> but Object ^ Field is impossible to confuse with NotField(Object).
> 
> That is a round-about way of saying -- it would be nice to get rid of
> Field(Object) and just use Object ^ Field.  This way you always know
> whether a function is intended to be used as a field accessor or not.

I don't understand how you're going to "get rid of" `Field(Object)'.
It's useful as a convention to use `Object ^ Field' for field references,
but I don't see how the compiler is going to enforce that.

The lack of distinction between fields and functions was deliberate.
It's useful to be able to redefine a field as a pair of functions
without changing any of the code that uses the field.
 
Simon.
--------------------------------------------------------------------------
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