another properties thread

Luhrel lucien.perregaux at gmail.com
Mon Apr 26 18:14:49 UTC 2021


On Thursday, 22 April 2021 at 07:44:42 UTC, drug wrote:
> 22.04.2021 05:41, Adam D. Ruppe пишет:
>> On Thursday, 22 April 2021 at 02:25:29 UTC, Moth wrote:
>>> [...]
>> 
>> 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.
>> 
>>> [...]
>> 
>> 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?

Some basic functionalities like `prop += 3` / `++prop` are not 
working.

12345swordy tried to fix that in PR 
[#12097](https://github.com/dlang/dmd/pull/12097), but there's no 
activity since 3 months so idk.


More information about the Digitalmars-d mailing list