Is there a Clojure convention for naming private functions?

There’s not a convention; the visual indicator is prevalent in languages with no built-in notion of private functions. Since Clojure’s functions defined with defn- are not visible outside their namespace, there is no need to prefix functions with an uglifier 😉 So do what you but, but you should probably want to just do as … Read more

How to remove multiple keys from a map?

Your remove-key function is covered by the standard library function dissoc. dissoc will remove more than one key at a time, but it wants the keys to be given directly in the argument list rather than in a list. So you can use apply to “flatten” it out. (apply dissoc {:foo 1, :bar 2, :baz … Read more

Can I make a fully non-blocking backend application with http-kit and core.async?

With the async approach you get to send the data to the client when its ready, instead of blocking a thread the whole time its being prepared. For http-kit, you should be using an async handler described in the documentation. After delegating the request to an async handler in a proper way, you can implement … Read more

Clojure caret as a symbol?

^ is “the meta character” it tells the reader to add the symbol starting with ^ as metadata to the next symbol (provided it is something that implements IMetas) user=> (def x ^:IamMeta [1 2 3]) #’user/x user=> x [1 2 3] user=> (meta x) {:tag :IamMeta} user=> You can learn a lot about how … Read more

deftype vs. defrecord

deftype creates a bare-bones object which implements a protocol. defrecord creates an immutable persistent map which implements a protocol. Which to use depends on what you want. Do you want a full ClojureScript data structure? Then use a record. Do you just want a bare-bones thing that does nothing but satisfy a protocol? Then use … Read more