I like json as a format for configuration files for the software I write. I like that it\'s lightweight, simple, and widely supported. However, I\'m finding that there are some
The EDN format is one option based on Clojure literals. It is almost a superset of JSON, except that no special symbol separates keys and values in maps (as :
does in JSON); rather, all elements are separated by whitespace and/or a comma and a map is encoded as a list with an even number of elements, enclosed in {..}
.
EDN allows for comments (to newline using ;
, or to end of the next element read using #_
), but not here-docs. It is extensible to new types using a tag notation:
#myapp/Person {:first "Fred" :last "Mertz"}
The argument of the myapp/Person
tag (i.e. {:first "Fred" :last "Mertz"}
) must be a valid EDN expression, which makes it unextensible to here-doc support.
It has two built-in tags: #inst
for timestamps and #uuid
. It also supports namespaced symbol (i.e. identifier) and keyword (i.e. map key consts) types; it distinguishes lists (..)
and vectors [..]
. An element of any type may be used as a key in a map.
In the context of your above problem, one could invent an #apache/rule-or
tag which accepts a sequence of elements, whose semantics I leave up to you!