Can I destructure a tuple without binding the result to a new variable in a let/match/for statement?

No.

Destructuring is something you can only do with patterns; the left-hand side of an assignment is not a pattern, hence you can’t destructure-and-assign.

See proto-RFC 372 (Destructuring assignment) which discusses the possibility of adding this feature.

Leave a Comment