Re:Show HN: jql – Easier jq Alternative with a Lispy Syntax ...
by michaelmrose on Wednesday January 08, 2020 @02:12PM
(#21994686)
Is it more readable than
(->> JSON
(elem "countries")
first)
Re:Show HN: jql – Easier jq Alternative with a Lispy Syntax ...
by cube2222 on Wednesday January 08, 2020 @02:57PM
(#21995110)
This looks very readable and matches the structure of the json too.
To me it's basically the same readability wise with proper indentation.
Though with deeply nested data and a lot of map functions I think you'd have a lot of unnecessary (->> JSON ...). But those can probably be eliminated with another macro.
Also, there's the pipe function in jql which basically lets you do this.
Yours is more akin to (elem 0 (elem "countries" json))
and you can see that the hierarchy of the query is now inverted in respect to the json. This is what I like about the continuation based approach, a big query will be readable because it fits the data very well.