toml-lang / toml

Tom's Obvious, Minimal Language
https://toml.io
MIT License
19.45k stars 847 forks source link

should support json colon in inline table to make some part of json valid for inline table? #866

Closed bronze1man closed 2 years ago

bronze1man commented 2 years ago

I just write something like this when i write a toml file:

VlanConfigList=[{PortId:2,EndPortId:14,VlanId:100},{PortId:15,EndPortId:28,VlanId:101},]

Maybe I write too much golang or js? I think different from json is not a goal for toml.

marzer commented 2 years ago

I think different from json is not a goal for toml.

Sorry but I think you're projecting what you want from TOML onto what you think the language sets out to do. From the TOML spec:

TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.

The 'obvious semantics' part here is key; TOML uses = for key-value assignments in regular tables, so it stands to reason it should do that for inline tables, too. Using (or additionally supporting) a different character just because it's inside a pair of {} seems to be anything but obvious, if you aren't coming in with preconceptions based on an (entirely different) language.

bronze1man commented 2 years ago

The 'obvious semantics' part here is key

It looks like we have different options about "obvious". That is ok. I just need another config language to fit my 'obvious semantics'. May be hjson or json5.