Extend array declaration capabilities (with possible breaking change)
Currently, arrays can be declared only this way: arrayWorkToo = arrayElement1 arrayElement2
My suggestion is possibly remove such way of defining them (may be to make parsing a bit more strict), and instead allow these: arrayWorkToo = [ 1, 2, 3 ] arrayWorkToo = [ “red”, “yellow”, “black” ] arrayWorkToo = [ [ 1, 2 ], [3, 4, 5] ] arrayWorkToo = [ arrayElement1, arrayElement2 ] arrayWorkToo = [ { x = 1, y = 2, z = 3 }, { x = 4, y = 5, z = 6} ]
Defacto there are few standards for reading/writing arrays in .ini/.conf files. I've simply implemented the one I've seen in Python applications I had to share config files with.
Examples: https://wakatime.com/faq#exclude-paths https://stackoverflow.com/questions/4097139/reading-array-from-config-file-in-python/47891483#answer-11296626
So I cannot accept your request to drop the support of this format, I think I will implement some sort of setting for array format instead.
I have a related request so I'm just putting this in here instead of making a new issue.
Could you make it possible to read duplicate keys?
Like
[mySection]
value=abc
value=def
So that I can get an array containing "abc" and "def"? Just being able to read it would be good enough for starters I think.
I guess I can manage for now with a loop but it would be nice to have.
@TomArrow makes sense