Ordered TOML?

Hello everyone,

I am on the process of upgrading to Julia 1.6, which includes a TOML package as part of the base libraries.

Before, I was using my own TOMLpackage, forked from here to returned an OrderedDict instead of a regular one.

Checking the new implementation I see that changing this:

const TOMLDict = Dict{String, Any}

to use an OrderedDict would probably be sufficient.

However maintaing my own fork is overkill, specially now that TOML is part of Base. Any ideas? Would it be possible to make a Pull Request to make the parser parametric? Maybe there is a good reason not to do this, in which case I would just maintain my own fork again.

Thanks in advance.

3 Likes

I also encountered this while working with my own TOML for the first time. Was a bit bummed to find that it was unordered (and thus hard to make a DataFrame from).

1 Like

A side observation is that this would be a non-issue if Julia’s default Dict was insertion ordered, https://github.com/JuliaLang/julia/issues/34265#issuecomment-571020454.

I wouldn’t mind that, but it is surely a more ambitious change that what I had in mind :stuck_out_tongue:

1 Like