First Draft: Turn properties into first class accessors
Paul Backus
snarwin at gmail.com
Wed Feb 5 03:14:53 UTC 2025
On Wednesday, 5 February 2025 at 02:39:18 UTC, 12345swordy wrote:
> https://docs.google.com/document/d/1bh-oho1vNpGpK7jaaBgitkV3fOY_but9oUQm5ObpQAQ/edit?usp=sharing
>
> Destroy!
Seems mostly reasonable, though there are a lot of details that
will need to be filled in for future drafts.
Some small suggestions:
> You can’t not take the address of the functions without using
> the traits via reflection
I assume "can't not" is an editing mistake, and what you mean is
"can't."
It would be much simpler to just say, "you can't take the address
of a @property function."
> You can’t use parentheses on them
I know what you mean by this, but in future drafts you will need
to actually spell out the exact rules, for both getters and
setters.
> Can’t pass it to ref parameters unless it returns as ref.
This is how it already works, right? It's a little confusing to
mix together new features and ones that already exist in the same
list.
> Can pass it to inout parameters, by having inout parameters
> accept property functions.
Same here--`inout` paramters already accept (the return values
of) @property functions, just like they accept the return values
of any other function.
More information about the dip.development
mailing list