I love the idea of a Lispy version of jq, but as a Lisper, the examples feel bewildering to me. The fact that (elem) takes an optional second argument, whose default value is 'identity, seems familiar, but then I try to understand this example, and it just doesn't make sense to me:
(elem "countries" (elem (keys) (elem "name")))
I think part of the problem is, IIUC, this is constructing a pipeline, like (->) in Clojure, but is using function call syntax rather than pipeline syntax, and also mixing in a function call with (keys). I feel like it's a very non-Lispy language masquerading as Lisp by wearing parens.
Instead, if you wrote it as real Lisp function calls, and provided a real pipeline macro, it would be much more Lispy and, I think, much easier to understand. For example, instead of:
(elem "countries" (elem (keys) (elem "name")))
Either of these alternative syntaxes:
(-> "countries" (key "name"))
(key "name" ("countries"))
Would return the same result:
["Poland",
"United States",
"Germany"]
While being more concise and more Lispy.
I also wouldn't mind using an anaphoric 'mapcar, something like:
(-> "countries" (map-> (key "name"))
Otherwise it may be unclear which functions implicitly map across entries and which don't.
My two cents. Thanks for sharing your work.