Python-like Use of the Comma Expression
Timon Gehr
timon.gehr at gmx.ch
Sat Aug 12 08:45:18 UTC 2023
On 8/12/23 03:41, Basile B. wrote:
> On Thursday, 10 August 2023 at 19:39:46 UTC, Timon Gehr wrote:
>> On 8/10/23 17:47, Basile B. wrote:
>>> On Thursday, 10 August 2023 at 15:41:16 UTC, ryuukk_ wrote:
>>>> [...]
>>>
>>> I'm reading the DIP with fresh eyes today, after having implemented
>>> tuples for another language. One think I see now, as that Timon's
>>> DIP, does not investigate, is that tuple deconstruction could use
>>> [in-situ variable
>>> declarations](https://gitlab.com/styx-lang/styx/-/releases/v0.10.15),
>>> i.e something that's not especially made for tuples and that works as
>>> a normal primary expression.
>>
>> Well, I think that should be a separate proposal, but it's
>> syntactically compatible. In any case, I would strongly prefer to be
>> able to still do `auto (x,y) = t;` in addition to `(auto x, auto y) = t;`
>
> `auto (x,y) = t;` works but `(auto x, auto y) = t;` does not because of
> the double inference.
I am not sure what you are saying. Both `auto (x, y) = t;` and
`(auto x, auto y) = t;` literally do already work with my prototype
implementation.
More information about the Digitalmars-d
mailing list