OT: Tuple Syntax and Placeholders (Re: First Draft: Tuple Unpacking Syntax)
Nick Treleaven
nick at geany.org
Fri Aug 1 10:36:37 UTC 2025
On Friday, 1 August 2025 at 10:08:09 UTC, 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];
> ```
Sorry, wrong code above.
```d
T a, b;
alias seq = AliasSeq!(a, b);
// auto (x, y) = seq;
auto x = seq[0];
auto y = seq[1];
```
> `a[0]` and `a[1]` are not moved by the lowered code.
>
> Do you have an example where there should be a move?
More information about the dip.development
mailing list