Third draft: Turn properties into first class accessors
12345swordy
alexanderheistermann at gmail.com
Thu Mar 20 18:40:06 UTC 2025
On Thursday, 20 March 2025 at 18:17:07 UTC, Richard (Rikki)
Andrew Cattermole wrote:
> Not in the format:
> https://github.com/dlang/DIPs/blob/master/Template.md
>
> The trait ``properties`` could be genericafied i.e.
> ``__traits(getFunctionOverload, func, void, int)`` for ``void
> func(int)``
>
> "If it is possbile for the parameters to read and write to the
> @property, then the inout parameter must be rewritten as two
> parameters that accept both the read and write functions of
> @property"
>
> Needs a spelling and grammer pass.
>
> However this example doesn't make sense to this specification.
>
> ``void void test(inout int x) { x += 1; }``
>
> That variable ``x`` there, is for one ``const`` and can't be
> mutated, and two isn't by-ref so it wouldn't affect the global
> anyway.
>
> I'm a tad unsure about this.
>
> Needs to explicitly mention that array slicing isn't possible.
I genuinely have no idea on where you got the
"__traits(getFunctionOverload, func, void, int)" from, because it
simply doesn't exist on my current third draft here.
More information about the dip.development
mailing list