4 ms·
(Relative) Clojure noob here: what stops someone from developing a similar library to honeysql, but instead of passing in vectors/maps, one created the data str
by lilactown 9y ago
(Relative) Clojure noob here: what stops someone from developing a similar library to honeysql, but instead of passing in vectors/maps, one created the data structure in a plain quoted form and passed it in?
e.g. the first example in the README could be turned into:
(def sqlmap
'(where (= :f.a "baz")
(from :foo (select [:a :b: :c])))
I understand that hiccup syntax can be awesome, but it seems like Clojure loses a bit of the magic of LISP when everything has to be written in terms of vectors/maps - what's wrong with a plain ol' list?
I imagine I'm probably missing something obvious or important, since I've only dabbled in Clojure (and loved it!)
- weavejester 9y agoNested lists are harder to perform lookups on than maps. If I want to know what the "from" part of the SQL query is, with HoneySQL I can write: (:from query) On the other hand, depending on your s-expression syntax, I'd either have to find the table name positionally, or by walking the tree.
- lilactown 9y agoThat makes sense. Thanks for the reply!