LLM's think we should have language tuples!
user1234
user1234 at 12.de
Fri Apr 4 17:35:06 UTC 2025
On Friday, 4 April 2025 at 14:03:56 UTC, user1234 wrote:
> On Friday, 4 April 2025 at 13:43:36 UTC, user1234 wrote:
>> On Tuesday, 1 April 2025 at 19:26:53 UTC, Timon Gehr wrote:
>>> - Unpacking does not yet support auto-expanding, for example:
>>>
>>> (AliasSeq!(int. int) x, int y) = tuple(1, 2, 3);
>>>
>>> does not work yet.
>>
>> Why should this work ? From the type system point-of-view it's
>> a bit like if you say that
>>
>> ```d
>> ((int,int), int) a = (1,2,3);
>> ```
>>
>> has to work. You dont have to support that.
>
> Sorry for the noise, i see the thing now... `AliasSeq!(int.
> int)` __is not a tuple__, it's supposed to expand to two
> disctint VarDecls within the parent tuple.
You probably have to lower that to
```d
alias __TempType = AliasSeq!(int,int);
__TempType x;
(x[0], x[1], int y) = tuple(1, 2, 3);
```
and put the three new things in a CommaExp. There might be
problems because of the context tho, it's not a straight path, so
some kinds of annoying flags might be required.
More information about the Digitalmars-d
mailing list