@property fields

Dom DiSc dominikus at scherkl.de
Sun Feb 2 10:19:05 UTC 2025


On Sunday, 2 February 2025 at 04:23:46 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> On 02/02/2025 4:41 PM, Walter Bright wrote:
>> I don't understand what problem this solves.
>
> Unfortunately that seems to be the consistent response.

Extending @property to fields maybe useless, but that doesn't 
make @property functions useless.

I like to have something that
- address cannot be taken of
- is only readable or
- is only writable
- can be created on the fly
- is indistinguishable from a regular field otherwise

We only need to make @property working that way.
To do so, only two things remain to be done:
- make using & on @property functions an error
- perform the neccessary lowerings to allow opOpAssign on 
@properties that have both getter and setter



More information about the dip.ideas mailing list