February 02 Re: @property fields | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard (Rikki) Andrew Cattermole | 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
|
February 03 Re: @property fields | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dom DiSc | On 02/02/2025 11:19 PM, Dom DiSc wrote:
> 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
If someone can figure out how it could be done, please make a new ideas thread on it!
|
Copyright © 1999-2021 by the D Language Foundation