Reddit: why aren't people using D?

Steven Schveighoffer schveiguy at yahoo.com
Mon Jul 27 12:36:45 PDT 2009


On Mon, 27 Jul 2009 15:30:17 -0400, bearophile <bearophileHUGS at lycos.com>  
wrote:

> Steven Schveighoffer:
>> property
>> {
>>     int x() {}
>>     void x(int n) {}
>>     bool empty() {}
>> }
>
> An alternative:
>
> property(x) {
>     ... // or getter and/or setter
> }

No, that is a different proposal.  All I was saying is if property is an  
attribute, then like other attributes (const, etc), code like this:

property int x() {}
property void x(int n) {}
property bool empty() {}

can be rewritten as above.

-Steve



More information about the Digitalmars-d mailing list