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.
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.
@BurntSushi :+1:
@BurntSushi :+1:
VCS diffs that are not as noisy would be one benefit to this feature
Most helpful comment
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 = valueto be that important.Also, TOML allows trailing commas, which makes one-item-per-line much more convenient anyway.