Closed WardBrian closed 9 months ago
As described in the design doc, it would be nice to support tuple unpacking or "destructuring assignment". Example:
int x; int y; (x, y) = (1, 2)
This would be great to support for tuple-returning functions like #1346
Some things to keep in mind:
(x,y) = (y,x); // should swap variables gracefully (a,b) = something_expensive(); // should only call function _once_
This can be implemented entirely in the frontend, since it in general desugars to (using the example above)
temp_tuple = something_expensive() a = temp_tuple.1 b = temp_tuple.2
As described in the design doc, it would be nice to support tuple unpacking or "destructuring assignment". Example:
This would be great to support for tuple-returning functions like #1346
Some things to keep in mind:
This can be implemented entirely in the frontend, since it in general desugars to (using the example above)