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

Multi-assignment #2

Closed
velipso opened this issue Oct 24, 2016 · 3 comments
Closed

Multi-assignment #2

velipso opened this issue Oct 24, 2016 · 3 comments

Comments

@velipso
Copy link
Owner

velipso commented Oct 24, 2016

I think, with the new precedence rules that put equals at the very bottom, we can now implement multiple lvalue assignment, like:

var x, y
x, y = 1, 2
x, y = y, x
# etc
@velipso
Copy link
Owner Author

velipso commented Oct 24, 2016

This is not just a syntactic freebie... it changes semantics:

var x
x = 1, 2, 3
say x # 1 or 3?

@velipso
Copy link
Owner Author

velipso commented Nov 2, 2016

Rejecting this idea.

The amount of combinations that need to be dealt with are too much. If designing a model is that complicated, then explaining the rules to a user is near impossible. We have enough complication with slicing, splicing, chained assignment, conditional assignment, mutation, and chained mutation.

@velipso velipso closed this as completed Nov 2, 2016
@velipso velipso added the wontfix label Nov 2, 2016
@velipso
Copy link
Owner Author

velipso commented Nov 3, 2016

Also (duh), just realized... I already have a form of multi-assignment. How could I have forgotten?!

{x, y} = {y, x}

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

No branches or pull requests

1 participant