Add basic support for array index for single/multi dimensional arrays.
Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
March 20 Third draft: Turn properties into first class accessors | ||||
---|---|---|---|---|
| ||||
March 21 Re: Third draft: Turn properties into first class accessors | ||||
---|---|---|---|---|
| ||||
Posted in reply to 12345swordy | 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 Re: Third draft: Turn properties into first class accessors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard (Rikki) Andrew Cattermole | 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 Re: Third draft: Turn properties into first class accessors | ||||
---|---|---|---|---|
| ||||
Posted in reply to 12345swordy | 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 Re: Third draft: Turn properties into first class accessors | ||||
---|---|---|---|---|
| ||||
Posted in reply to 12345swordy | On Thursday, 20 March 2025 at 17:52:20 UTC, 12345swordy wrote: >Add basic support for array index for single/multi dimensional arrays. Several major issues here:
|
March 24 Re: Third draft: Turn properties into first class accessors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Backus | 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: >Add basic support for array index for single/multi dimensional arrays. Several major issues here:
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. |
Copyright © 1999-2021 by the D Language Foundation