@property - take it behind the woodshed and shoot it?

Walter Bright newshound2 at digitalmars.com
Fri Jan 25 00:19:28 PST 2013


On 1/24/2013 5:15 PM, kenji hara wrote:
> 1. Optional parentheses for normal functions should work shallowly IMO.
> 2. Optional parentheses for property functions should not work. Applying () for
> property function name always applied to its returned value.
>
> #1 is a ratification of current behavior. It allows the combination of UFCS and
> removing redundant ()s.
> #2 is a breaking change. If we need it, community consent is required.

There is a way to do #2 without breaking existing code.

Create a new property attribute, say, @prop. Imbue it with the new behavior. 
Leave the old @property as it is, and let it cycle through the usual warning, 
deprecation, removal process.



More information about the Digitalmars-d mailing list