OT: Tuple Syntax and Placeholders (Re: First Draft: Tuple Unpacking Syntax)
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Fri Aug 1 22:06:44 UTC 2025
On 01/08/2025 10:08 PM, Nick Treleaven wrote:
> On Sunday, 27 July 2025 at 21:52:15 UTC, Richard (Rikki) Andrew
> Cattermole wrote:
>> 2. Moving elements should be in DIP even if implementation doesn't
>> support it. I don't think anything special needs to be done here. My
>> understanding is the compiler should be seeing the VarDeclaration ->
>> VarDeclaration assignment and handle it normally.
>
> I think you are asking for something special:
>
> ```d
> T a, b;
> alias seq = AliasSeq!(a, b);
> // auto (x, y) = a;
> auto x = a[0];
> auto y = a[1];
> ```
>
> `a[0]` and `a[1]` are not moved by the lowered code.
>
> Do you have an example where there should be a move?
You are getting to what I was thinking, there is no reason to mention
copying or moving. Its defined behavior elsewhere.
More information about the dip.development
mailing list