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

Peter Schachte schachte at cs.mu.OZ.AU
Mon Jul 9 12:11:11 AEST 2001


On Sat, Jul 07, 2001 at 01:05:11AM +1000, Fergus Henderson wrote:
> On 06-Jul-2001, Ralph Becket <rbeck at microsoft.com> wrote:
> > Can this problem not be resolved by considering (^) as
> > method invocation rather than field access?  Java, C# etc.
> > are all quite happy to overload (.) for field access and
> > method invocation.
> 
> Those languages distinguish field access from method invocation
> by the absence or presence of "()" after the field/method name.

But to achieve information hiding, those languages require you to write
accessor functions and use them instead of directly accesssing the data
members.  This, of course, means that outside the class definition, both
field accesses and method invocations have the trailing parentheses.  So
those languages don't give you what you want, either, even though they do
make a strong distinction between data and function members.

-- 
Peter Schachte <schachte at cs.mu.OZ.AU>  The C Programming Language -- A
http://www.cs.mu.oz.au/~schachte/      language which combines the
Phone:  +61 3 8344 9166                flexibility of assembly language with
Fax:    +61 3 9348 1184                the power of assembly language. 
--------------------------------------------------------------------------
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