-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unpacking nested tuples in for loop #2436
Comments
I consider this uglier than what we have currently, for example for for (i, x) in @[1, 2,3]: ... |
I don't consider that ugly. |
That will break a LOT of code, time for |
We can allow both I guess. |
And deprecate the old one? Not sure how to implement the deprecation in the parser, but it should be possible. And I currently don't see a problem with syntax ambiguities either. |
Superseded by #7486 (more comments and discussion there). |
@narimiran This issue is asking for nested tuple unpacking.
So this is kind of asking for general pattern matching support which as per Araq's opinion should be written as a macro. So this RFC has very less chances of being accepted anyways. |
@nc-x So your solution doesn't work for the nested tuples? Can you make it work? :) |
No, my patch doesn't support nested tuple unpacking. I didn't add it because the language does not support nested tuple unpacking anywhere. IDK if araq wants them in the language. |
PRs for nested tuple unpacking will be accepted. |
Should we make it a requirement to include the parenthesis when unpacking tuples in for loops? This will in turn allow for this to work:
And be consistent with tuple unpacking in var/let declarations.
The text was updated successfully, but these errors were encountered: