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

Simon Taylor stayl at cs.mu.OZ.AU
Wed Jul 4 06:42:58 AEST 2001


On 03-Jul-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 03-Jul-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > 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.
> 
> The proposal above preserves that property.  The advantage is that
> it makes it obvious when a function is intended to be used as a field
> accessor, and when a field accessor is used as a function.  It avoids
> accidental overloading between field names and functions or constructors
> that happen to have the same name.  If you want to refer to the field
> accessor as a function (e.g. to pass to a higher-order function such as
> `list__map'), you can still do so, you just have to use 'foo =' rather
> than 'foo'.

I still don't see the point. Why is accidental overloading between
field accessors and functions worse than accidental overloading between
functions and constructors?

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