Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lists in the style of TOML #613

Closed
Gin-Quin opened this issue Apr 20, 2019 · 13 comments
Closed

Lists in the style of TOML #613

Gin-Quin opened this issue Apr 20, 2019 · 13 comments

Comments

@Gin-Quin
Copy link

Gin-Quin commented Apr 20, 2019

For now, TOML lists are JSON-like :

myVegetables = [
  'potato',
  'onion',
  'tomato',
]

Wouldn't it be more TOML-ish to allow to define lists this way :

[myVegetables]
'potato'
'onion'
'tomato'

With this simple rule : if an element has no key, just a value (or just a key and no value, depending on the point of view), it's a list element and its parent is a list.

I'm actually the author of a TOML's Javascript parser, with which I allowed this syntax because it felt so comfortable (I had many URL lists in my configuration file).

@drunkwcodes
Copy link

Wat?

@ChristianSi
Copy link
Contributor

Lists shouldn't use table syntax, that would be too confusing. I think a case could be made for making the comma between list items optional if they were separated by a newline instead. This would allow writing:

myVegetables = [
  'potato'
  'onion'
  'tomato'
]

@Gin-Quin
Copy link
Author

Yes, I also think commas are unnecessary.

@drunkwcodes

This comment has been minimized.

@eksortso

This comment has been minimized.

@drunkwcodes

This comment has been minimized.

@eksortso

This comment has been minimized.

@drunkwcodes

This comment has been minimized.

@ChristianSi

This comment has been minimized.

@drunkwcodes

This comment has been minimized.

@TheElectronWill

This comment has been minimized.

@drunkwcodes
Copy link

@pradyunsg Please mark the second reply as off-topic too. (#613 (comment))

And commas in the list are necessary IMHO.

@pradyunsg
Copy link
Member

pradyunsg commented May 8, 2019

Nice catch @drunkwcodes!


I don't think the syntax proposed by OP is good since it's easy to confuse it with tables. The newlines as delimiters discussion is an interesting one but it's a post 1.0 discussion, since it's scope can be bigger than just lists (see #551).

Since I'm trying to keep focus on getting 1.0 ready soon (#617), I'm going to go ahead and close this issue. Thanks @wycats for filing this issue and everyone who contributed to this discussion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants