-
Notifications
You must be signed in to change notification settings - Fork 549
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
Use a <- v
instead of a = append(a, v)
#2107
Comments
a <- x
instead of a = append(a, x)
a <- v
instead of a = append(a, v)
compileSendStmt: support slice append (#2107)
#2107 parser: send statement in parseSimpleStmtEx
but in a 'for loop' statement, the syntax 'a <- v' means 'a' will iterate through each element of v, which can be a little confusing if we reuse '<-' to replace a slice 'append()'. proposal: it might be better to use 'for a in v' instead of 'for a <- v'. |
Related issue: #295 (reopened) |
supported in #2166 |
Proposal
In Go:
In Go+:
Easier to understand.
The text was updated successfully, but these errors were encountered: