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

Optional comma in multi-line arrays #227

Closed
ChristianSi opened this issue Jun 27, 2014 · 4 comments
Closed

Optional comma in multi-line arrays #227

ChristianSi opened this issue Jun 27, 2014 · 4 comments

Comments

@ChristianSi
Copy link
Contributor

I would like to propose a small change to the array syntax: make the comma between elements optional if they are separated by a newline. This would allow writing this array:

colors = [ "red", "yellow", "green" ]

alternatively like this:

colors = [
  "red"
  "yellow"
  "green"
]

Of course, commas after elements would still be allowed but they wouldn't be required provided the element is followed by newline.

This would be nicer for humans to write, and it would make the syntax of multi-line arrays more consistent with tables, where key/value pairs are likewise separated by just a newline.

@BurntSushi
Copy link
Member

I'm against this purely because it's another addition to the spec and there isn't much to be gained IMO. I don't really see a consistency between value arrays and key = value to be that important.

Also, TOML allows trailing commas, which makes one-item-per-line much more convenient anyway.

@88Alex
Copy link

88Alex commented Jun 27, 2014

@BurntSushi 👍

1 similar comment
@mojombo
Copy link
Member

mojombo commented Jun 27, 2014

@BurntSushi 👍

@paul-hammant
Copy link

VCS diffs that are not as noisy would be one benefit to this feature

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

No branches or pull requests

5 participants