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

Robert jfanatiker at gmx.at
Thu Jan 24 15:01:23 PST 2013


There is, just don't do:

@property int a;

but

int a_;

@property int a() { return a_}

-> Omitting the setter. It is a bit more verbose than the C# version,
but adding syntactic sugar later on, if really desired, should not be
too hard.

And thanks for the C# implementation description.


On Thu, 2013-01-24 at 14:48 -0800, Adam Wilson wrote:
> The syntax provides no way to define read-only or write-only
> properties.  
> Other than that I love it, but I am a biased C# guy.




More information about the Digitalmars-d mailing list