-
Notifications
You must be signed in to change notification settings - Fork 451
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
RFC: Allow trailing comma after the last element of a list #2635
Comments
@Kha I think this is a good change, and I recall discussing it with you in the past. However, I don't remember why we didn't move forward. I don't have time to do it myself, but I will support a PR. BTW, let's ensure the trailing comma is accepted in other similar notation. |
What do you mean by accepted in other similar notation? |
e.g. if this is allowed, then |
I am quite sure it was lack of sufficient motivation. So I agree with
|
Closing this issue since PR #2643 has been merged. |
Proposal
Currently this is not legal Lean:
let li = [ item1, item2, ]
but if it were legal, adding new elements would not entail changes to existing lines:
let li = [ item1, item2, item3, item4, ]
This has two main benefits:
Trailing comma is already supported in Rust and Python.
Community Feedback
Ideas should be discussed on the Lean Zulip prior to submitting a proposal. Summarize all prior discussions and link them here.
Discussion thread
James Gllicchio proposed that we could also have preceding commas:
let li = [ , item1 , item2 ]
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: