Thread overview
Third draft: Turn properties into first class accessors
March 20

https://github.com/12345swordy/Public-Documents/blob/048fe63bd1e7197c4db9f5794ec5334dc3c615a6/properties.md

Add basic support for array index for single/multi dimensional arrays.

March 21
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.
March 20
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.
March 21
On 21/03/2025 7:40 AM, 12345swordy wrote:
> 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.

Right, the trait you came up with is much more specific but could be broadened out to other use cases.

March 21

On Thursday, 20 March 2025 at 17:52:20 UTC, 12345swordy wrote:

>

https://github.com/12345swordy/Public-Documents/blob/048fe63bd1e7197c4db9f5794ec5334dc3c615a6/properties.md

Add basic support for array index for single/multi dimensional arrays.

Several major issues here:

  • The exact syntax and semantics of __traits(properties) are not specified anywhere.
  • The rewrite involving @property arguments and inout parameters is not adequately explained. Under what circumstances is this rewrite performed, and how exactly is the function rewritten?
  • The array indexing examples have nothing to do with property access. Instead, they are a new form of operator overloading.
March 24

On Friday, 21 March 2025 at 01:34:45 UTC, Paul Backus wrote:

>

On Thursday, 20 March 2025 at 17:52:20 UTC, 12345swordy wrote:

>

https://github.com/12345swordy/Public-Documents/blob/048fe63bd1e7197c4db9f5794ec5334dc3c615a6/properties.md

Add basic support for array index for single/multi dimensional arrays.

Several major issues here:

  • The exact syntax and semantics of __traits(properties) are not specified anywhere.
  • The rewrite involving @property arguments and inout parameters is not adequately explained. Under what circumstances is this rewrite performed, and how exactly is the function rewritten?
  • The array indexing examples have nothing to do with property access. Instead, they are a new form of operator overloading.

It not operator overloading, its property access with regards to accessing the element themselves rather than array itself. The syntax itself is more of a suggestion rather than a hard code requirement.