DIP23 draft: Fixing properties redux

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Feb 3 00:16:08 PST 2013


Walter and I have had a discussion on how to finalize properties.

http://wiki.dlang.org/DIP23

We got input from DIP21 (which we didn't want to clobber, hence the new 
DIP) and the recent discussion.

The proposal probably won't be accepted in its current form because it 
breaks some code. We hope to bring it to good shape with everyone's help.

In brief:

* Optional parens stay.

* Just mentioning a function or method without parens does NOT 
automatically take its address. (This is a change from the current 
behavior.)

* Read properties (using @property) work as expected with the mention 
that they may NOT be called with the parens. Any parens would apply to 
the returned value.

* Write properties (using @property) may only be used in the assignment 
form (no function-style call allowed).

It is understood that the current proposal is just a draft and there 
must be quite a few corner cases it doesn't discuss. We also understand 
it's impossible to reconcile all viewpoints and please all tastes. Our 
hope is to get to a point where the rules are self-consistent, 
meaningful, and complete.


Destroy.

Andrei


More information about the Digitalmars-d mailing list