Hacker News new | past | comments | ask | show | jobs | submit login

(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!)




Nested 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.


That makes sense. Thanks for the reply!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: