I frequently use JsonNode as a container for Any object.

Another use case is how it's used for JSON, YAML, XML, etc. formats. Right now 
every such library had to create its own object mapper. While it would be much 
easier if `std/any` provided the `Any <-> Nim` conversions, and the custom 
library only need to provide `Any <-> JSON/YAML/XML`.

It will also make possible to easily switch between formats. You set some 
custom serialisations for your objects to JSON. And now you want to also save 
it to YAML, but you can't because YAML is totally different library and you 
need to specify custom serialisation rules again. But with `Any` it would work 
well, as it's going to work like this `Nim <- custom rules -> Any` and then 
totally independent `Any <-> JSON/YAML/...`

What do you think?

Reply via email to