Skip to content
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

Add comma seperated support for variable declarations on one line #18

Open
DanCardin opened this issue Mar 28, 2015 · 5 comments
Open
Labels

Comments

@DanCardin
Copy link
Collaborator

pending discussion of what it should look like.

@TheDan64
Copy link
Owner

var a = 1, b = 5, c = 5 for a single line?
And you can split the stuff between commas over multiple lines if you wish.

@DanCardin
Copy link
Collaborator Author

that or var a, b, c = 1, 2, 3. This way you need implicit tuples and destructuring. The way you suggest, seems like it would be its own syntax, and im not sure what multiple line support would be like unless you wrapped the whole thing in parenthesis

@TheDan64
Copy link
Owner

TheDan64 commented Apr 2, 2015

var a, b, c = 1, 2, 3 is definitely better.

But It isn't really destructuring unless you're doing var a, b, c = some_tuple

var a, b, c = 1, 2, 3 really just expands to three separate and unrelated assignments.

@DanCardin
Copy link
Collaborator Author

How do you disambiguate between this and actual destructuring

@TheDan64
Copy link
Owner

TheDan64 commented Apr 2, 2015

Based on whether you have 1 item on the RHS or an equal number of items as the LHS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants