{"action":"created","issue":{"url":"https://api.github.com/repos/toml-lang/toml/issues/413","repository_url":"https://api.github.com/repos/toml-lang/toml","labels_url":"https://api.github.com/repos/toml-lang/toml/issues/413/labels{/name}","comments_url":"https://api.github.com/repos/toml-lang/toml/issues/413/comments","events_url":"https://api.github.com/repos/toml-lang/toml/issues/413/events","html_url":"https://github.com/toml-lang/toml/issues/413","id":154370196,"number":413,"title":"Reduce verbosity of sub tables","user":{"login":"dstufft","id":145979,"avatar_url":"https://avatars.githubusercontent.com/u/145979?v=3","gravatar_id":"","url":"https://api.github.com/users/dstufft","html_url":"https://github.com/dstufft","followers_url":"https://api.github.com/users/dstufft/followers","following_url":"https://api.github.com/users/dstufft/following{/other_user}","gists_url":"https://api.github.com/users/dstufft/gists{/gist_id}","starred_url":"https://api.github.com/users/dstufft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dstufft/subscriptions","organizations_url":"https://api.github.com/users/dstufft/orgs","repos_url":"https://api.github.com/users/dstufft/repos","events_url":"https://api.github.com/users/dstufft/events{/privacy}","received_events_url":"https://api.github.com/users/dstufft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-12T00:10:14Z","updated_at":"2016-06-14T18:07:09Z","closed_at":null,"body":"Right now since sub tables require repeating the keys of any of it's parent tables, any situation where you want multiple sub tables, particularly nested, tends to end up being very verbose, looking something like:\r\n\r\n```toml\r\n\r\n[a]\r\nvalue = 1\r\n\r\n[a.b]\r\nvalue = 2\r\n\r\n[a.c]\r\nvalue = 3\r\n\r\n[a.c.d]\r\nvalue = 4\r\n\r\n[a.e]\r\nvalue = 5\r\n```\r\n\r\nThis I believe makes TOML uglier than it needs to be for situations where you end up with multiple nested sub tables. The problem primarily comes from the repeated key names of the parent tables, so what if TOML just allowed you to omit that? So essentially the above would become:\r\n\r\n```\r\n[a]\r\nvalue = 1\r\n\r\n[.b]\r\nvalue = 2\r\n\r\n[.c]\r\nvalue = 3\r\n\r\n[..d]\r\nvalue = 4\r\n\r\n[.e]\r\nvalue = 5\r\n```\r\n\r\nThe rule would be pretty simple, the ``.`` make it relative to the previously defined table with one fewer ``.``.\r\n\r\nWhile whitespace is still optional, you can make it more immediately obvious what is going on by applying some whitespace here to turn the above into something like:\r\n\r\n\r\n```\r\n[a]\r\nvalue = 1\r\n\r\n  [.b]\r\n  value = 2\r\n\r\n  [.c]\r\n  value = 3\r\n\r\n    [..d]\r\n    value = 4\r\n\r\n  [.e]\r\n  value = 5\r\n```"},"comment":{"url":"https://api.github.com/repos/toml-lang/toml/issues/comments/225966260","html_url":"https://github.com/toml-lang/toml/issues/413#issuecomment-225966260","issue_url":"https://api.github.com/repos/toml-lang/toml/issues/413","id":225966260,"user":{"login":"franklinyu","id":3153452,"avatar_url":"https://avatars.githubusercontent.com/u/3153452?v=3","gravatar_id":"","url":"https://api.github.com/users/franklinyu","html_url":"https://github.com/franklinyu","followers_url":"https://api.github.com/users/franklinyu/followers","following_url":"https://api.github.com/users/franklinyu/following{/other_user}","gists_url":"https://api.github.com/users/franklinyu/gists{/gist_id}","starred_url":"https://api.github.com/users/franklinyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franklinyu/subscriptions","organizations_url":"https://api.github.com/users/franklinyu/orgs","repos_url":"https://api.github.com/users/franklinyu/repos","events_url":"https://api.github.com/users/franklinyu/events{/privacy}","received_events_url":"https://api.github.com/users/franklinyu/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T18:07:09Z","updated_at":"2016-06-14T18:07:09Z","body":"Interesting, but that might lead to \"overhead\" in your mind: when you see\r\n\r\n```toml\r\n[..key]\r\nvalue = 1\r\n```\r\n\r\nyou need to look above (possibly far away) to search for `[.b]` and `[a]`, which (I guess) explains the downvotes."}}
{"actor":{"display_login":"franklinyu"}}