property / getProperty() / setProperty()

Rainer Deyke rainerd at eldwood.com
Sat Aug 1 11:31:28 PDT 2009


Ary Borenszweig wrote:
> The "property" just signals that the function is a property. But it's
> still a function and all of the previous rules that existed are still
> valid.

My problem with the 'property' syntax:

Possibility 1: the property still acts like a function, so you can still
do 'x.a()' when you mean 'x.a'.

Possibility 2: the property does not act like a function, so you can no
longer get a delegate to the property getter.

Possibility 3: the property sometimes acts like a function and sometimes
not, and you haven't defined the distinction.

All three possibilities are messy, and I can't tell from your proposal
which one will apply.  get_foo/set_foo is better in this regard, plus it
doesn't require yet another keyword.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list