Let all Tables implement an attribute collection separate from normal keys, where the attribute is specified as a normal key with a @ symbol. Preferably, this leading @ should be allowed in bare keys. Maybe even only restrict it to bare keys.
To closer mimic behavior of for instance XML, which i'm trying my best to get rid of in my work environment and replace with TOML.
Currently, there are a lot of well-established configuration files that I do not want to change the semantics of, makes slight use of XML attributes, so make an all-in-one swoop transition from XML to TOML, I need to support some sort of attributes on sections (Tables).
In the configuration management tool i'm currently writing, I'm implementing a TOML output format.
To support section attributes, i will need to manually extract all table keys starting with a @ and
treat them as attributes.
I believe having TOML specifically treat (bare) keys with leading @ as table attributes leads to simplified code using the parsed result, as well as making TOML more versatile at little cost.
# This is my config file.
@CONFIG_VERSION = '1.2.3'
[[definition]]
@mission = 'SENTINEL 1A'
international_designator = '2014-016A'
[[definition]]
@mission = 'TERRA'
international_designator = '1999-068A'
The equivalent XML is
<missions>
<definition mission="SENTINEL 1A">
<international_designator>2014-016A</international_designator>
</definition>
<definition mission="TERRA">
<international_designator>1999-068A</international_designator>
</definition>
</missions>
Here is why I think it's a bad idea:
@ and organize your data accordingly.Since this suggestion was not met with great enthusiasm, I'll lay waste to it.
Most helpful comment
Here is why I think it's a bad idea:
@and organize your data accordingly.