LLM's think we should have language tuples!

Timon Gehr timon.gehr at gmx.ch
Fri Apr 4 18:39:40 UTC 2025


On 4/4/25 16:07, Nick Treleaven wrote:
> On Friday, 4 April 2025 at 13:59:52 UTC, Nick Treleaven wrote:
>> Assigning to a tuple literal seems to be a no-op ATM:
>> ```d
>> void main()
>> {
>>     int a,b;
>>     (a, b) = (4, 5);
> 
> That line lowers to:
> ```d
>      tuple(a, b).opAssign(tuple(4, 5));
> ```
> So it's assigning to a temporary tuple copy of a and b's data, rather 
> than the fields by reference.

Yes, the tuple-syntax branch is less ready than the unpacking branch.


More information about the Digitalmars-d mailing list