lisp

Leveraging Clojure-power for SQL generation with HoneySQL

One of the most meaningful testaments to Clojure’s data-driven and lisp-powered design is the ability to use it to refine any of its transpiling processes, here SQL generation (elsewhere route generation, CSS generation, and of course its actual hosted languages, including Javascript or Java generation*). In this post I was tasked with refactoring a 3-arg function that reads from the database into a map-taking function that works with one, two, or three items in the map.

A Gotcha: test.core/thrown?

https://clojureverse.org/t/a-gotcha-test-core-thrown/5595/1 Clojure is generally such a pristine and sensible language, it took me some debugging time to find out why this was failing: (is (let [proctorless-rmap {:tester (:id tester) :test (:id this-test)}] (thrown? Exception (xreg/register-for-exam proctorless-rmap)) "no proctor should fail")) ;; Unable to resolve symbol: thrown? in this context Trying to solve this at the repl, I was stumped for quite a while by why I couldn’t locate the thrown? function with C-c C-.