Open tencnivel opened 5 years ago
Also stumbled upon this, for me unexpected, behavior, especially since loading and saving the conf again introduces silent data loss (everything behind a whitespace w/o comma)
@grhartl Indeed that's not great. I'm not too sure what's the intention was here :
https://github.com/JuliaIO/ConfParser.jl/blob/master/src/ConfParser.jl#L95
My guess was to split values by comma (not sure if that's in the ini specs) and filter out possibly resulting whitespace values.
e.g.
foo = 1,2 -> [1,2]
foo = 1, ,3 -> [1,3]
I would maybe just remove that whitespace cleaning part, what do you think ?
Thanks for the fast response. As far as i know there are no offical, uniform ini specs.
Imo moving filtering to the user makes those case more work for the user, but would solve this issue. I would lean towards parsing and saving as literal as possible .As another example, someone may (even if rather brittle) want to index a specific element by position? From my perspective, I would consider the data loss a bug, while the parsing of ", ," is a design choice up to you.
I don't understand why Issue #12 was closed.
Why can't we just strip the values as in the following? It seems to work fine even with comma separated values