Function calls

Michiel Helvensteijn m.helvensteijn.remove at gmail.com
Thu Jan 28 14:23:24 PST 2010


Andrei Alexandrescu wrote:

> I agree. So where's the consensus? Things seemed so clear when people
> were beaten with @property over their head.

If I read the TLP correctly, @property seems not to be working correctly.

@property (or any other notation marking property getters/setters) should be
enforced. Functions that have it must only be invoked using property
syntax. Functions that don't have it must be called with parentheses.
That's the whole point. To give the designer of the class control over how
it is used.

The problem is people blurring the line between what's supposed to be a
function and what's supposed to be a property, by abusing property syntax
to invoke actions without parentheses.

In reality, I believe there's not only a clear line between the two
intentions, there's a demilitarized zone. You just need to enforce it. You
can't have your cake and eat it too.

-- 
Michiel Helvensteijn




More information about the Digitalmars-d mailing list