another properties thread

drug drug2004 at bk.ru
Thu Apr 22 07:44:42 UTC 2021


22.04.2021 05:41, Adam D. Ruppe пишет:
> On Thursday, 22 April 2021 at 02:25:29 UTC, Moth wrote:
>> this was an upset, but dealable - it was ugly and long-winded, but i 
>> could work around the limitation by using manual getter and setter 
>> methods.
> 
> The @property annotation does almost nothing, so you can still do 
> properties without the annotation.
> 
> The only thing @property actually does is change `typeof(obj.prop)` 
> afrom function over to the type it returns.
> 
>> i would much, *much* rather use @property than not.
> 
> Why? What exactly do you need it to do?
> 
> (I myself want property to be fixed but I have a specific list of cases 
> why, so curious what you are thinking of...)

I use @property in my gui, it is really handy to be able to draw all 
public members and properties of some data structure just passing it to 
widget using reflection. In other case I would be forced to use yet 
another attribute, but this attribute wouldn't be so handy because 
@property is a part of the language. I do not hesitate to use properties 
in my code and still have no any problem with them, so why not?


More information about the Digitalmars-d mailing list