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

ERL-681: Allow trailing commas in lists and tuples #4084

Open
OTP-Maintainer opened this issue Jul 28, 2018 · 1 comment
Open

ERL-681: Allow trailing commas in lists and tuples #4084

OTP-Maintainer opened this issue Jul 28, 2018 · 1 comment
Labels

Comments

@OTP-Maintainer
Copy link

Original reporter: vassilevsky
Affected version: Not Specified
Component: Not Specified
Migrated from: https://bugs.erlang.org/browse/ERL-681


Hello :)

New Erlang user here :)

It would have been really nice to be able to put commas at the end of every element in a vertically formatted list or a tuple.

There has been EEP 21 (http://erlang.org/eeps/eep-0021.html) — what has happened to it?
@OTP-Maintainer
Copy link
Author

mikael pettersson said:

Even if it's easy to implement, the fact that the EEP has been sitting there for so long with no followups indicates that this isn't viewed as a big problem in the Erlang community.

I agree that having to change (insert or delete) a comma on an adjacent line when adding or deleting an item in a vertical list (including records, tuples and argument lists) is annoying.  In our code base (Klarna) we like to use a "comma first" style for those which avoids the problem, .e.g.

{noformat}
-export([ foo/0
        , fie/1
        , fum/2
        ]).
{noformat}

I you _really_ want the "allow comma after last item" feature you need to implement it and submit a PR, or convince someone else to do so.  Also, this is perhaps best brought up on the erlang-questions mailing list and not issued as a bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant