-
Notifications
You must be signed in to change notification settings - Fork 28
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
Syntax question: to let
or not to let
#217
Comments
This probably makes parsing easier too, as you would presumably write
and
Right now we need a bit of goofy lookahead to handle these cases. |
I prefer having |
@vemoo want to try implementing it? |
sure |
221: Let declarations r=nikomatsakis a=vemoo Implements #217 I was going to update the book but I think it was already outdated since it uses `my foo = bar` instead of `foo: my = bar`. ¿Should updating the book be a separate PR?. Also I didn't find any test for atomic local variable declarations, ¿should one be added? Co-authored-by: Bernardo Uriarte <[email protected]>
I also prefer keywords to introduce variables. I think it's because it's a strong visual indicator that new state is being created. |
this was implemented in #221 |
In the current dada syntax, if you use
=
you declare a new variable:and if you use
:=
, you can reassign an existing place:I was going for an extremely "lightweight" syntax reminiscent of Python, but to be honest, I'm not sure I like it. I am thinking maybe it's better to follow Rust (and, I realize, Java/TypeScript?) precedent here and use
let
:and then just use
=
for reassignment:Thoughts?
The text was updated successfully, but these errors were encountered: