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

Compound assignment #43

Open
Mercerenies opened this issue Jun 15, 2018 · 0 comments
Open

Compound assignment #43

Mercerenies opened this issue Jun 15, 2018 · 0 comments

Comments

@Mercerenies
Copy link
Owner

Consider allowing operators such as +=. So the following desugaring process would occur

;; Original statement
foo bar += 1.
;; Desugar the compound operator
foo bar = foo bar + 1.
;; Desugar the accessor
foo bar= (foo bar + 1).

With the exception that foo would only be evaluated once. This would, strictly speaking, be a breaking change, as foo bar += 1 is currently a valid statement in Latitude.

Additionally, we would need to consider what operators this should work for. It can't work for things like == or ===, or a rather silly desugaring process would take place.

a == b.
a = a = b.
a= (a = b).

Which is obviously undesired, not to mention syntactically invalid.

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