Make spec neutral regarding array-of-table naming style #938
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an outcome of #932. Right now the spec only uses the "plural" naming conventions in its array-of-tables examples. However, it is far from clear that this is the only legitimate convention in such cases. Consider as example:
This might seem unintuitive and perhaps even confusing to the reader or editor of the TOML file, since each
[[...]]
section header is only followed by a single instance of the described item (a planet, in this case). This can be made clearer by using the "singular" naming convention instead, and prominent TOML users such as Cargo do indeed use the "singular" naming style for arrays of tables (in Cargo:[[bin]]
,[[example]]
,[[test]]
, and[[bench]]
).The spec, however, currently uses the "plural" naming style in all its array-of-table examples, which may give the impression that that's the normal and preferred naming style. This PR makes the spec "neutral" in that regard, by switching one example (the "product[s]" example) to singular style, while leaving the other example (the "fruits" example) in plural style. This should make it clearer that either style is fine.
Why modify the "products" rather than the "fruits" example? I have no strong preference here; I choose the former simply because it's the smaller change (it only has three section headers, while the "fruits" example has six). But I would be happy to adapt the latter instead if that's for some reason preferred.