-
-
Notifications
You must be signed in to change notification settings - Fork 21
Add assignment operator #158
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
Conversation
69dbf7d to
2e1b9dc
Compare
|
I think there's mostly 1 case not working properly right now: This is hard because we both need to copy and drop I'm now pondering what the right solution is. The most proper thing to do would be to have some lifetime analysis which recognizes that the old |
|
I think that's all for this feature? It feels like such a big deal that it's hard to believe, but looks fine so far, even under Valgrind. |
bal-e
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No logic issues, just asking to move some control flow around.
5d5b61e to
02f1206
Compare
For now, this can only assign to local variables and not to full paths, which is what I ultimately want to achieve as a (partial) solution to #156 and other issues.
Closes #159
Having an assignment operator is also useful for things like setting values based on
if-else:You can write this as:
But that gets annoying with multiple variables or when the branches call other functions.
Finally, this will make it useful to implement loops. Without assignment, it's quite hard to make loops useful.
The other use of this is with overriding default values: