Third draft: Turn properties into first class accessors

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Mar 20 18:17:07 UTC 2025


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 paramaters to read and write to the 
@property, then the inout parameter must be rewritten as two paramaters 
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.


More information about the dip.development mailing list