Sets plus JSON

Axel Rauschmayer axel at
Wed Oct 3 12:14:00 PDT 2012

Another reviver-friendly possibility: type tags for objects (arrays remain as they are).

    { "__type__": "Date", "time": 1349291353269 },
    { "__type__": "Object", "first": "Jane", "last": "Doe" },
    { "__type__": "Map", "entries": [ ["first", "Jane"], ["last", "Doe"] ] }

This assumes that the keys of objects are known beforehand (to avoid a key from clashing with "__type__"). Keys of maps can be arbitrary, even type-tagged objects.

On Oct 3, 2012, at 20:49 , Brandon Benvie <brandon at> wrote:

> Taking a cue from plist, which is easily transformed to and from JSON, you would end up with something like
> [{ key: {...key..}, value: {...value...} }]
> which is less space efficient but pretty easy to automatically convert back to a map (aside from correctly handling duplicate values).
> _______________________________________________
> es-discuss mailing list
> es-discuss at

Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list