Lesser known Clojure every-pred and some-fn functions
The common thing in functional programming is combining “smaller” functions into the bigger one (higher-order functions). The examples of such functions are
some-fn. Both those functions were added to Clojure in release 1.3.
Lesser known Clojure: variants of threading macro
The threading macros (
->>) provide easy to understand and read mechanism of sequential transformation of data in Clojure. I’m pretty sure that you know it, but for the sake of clarity I start this post with a recap.
My Emacs configuration
Today I finally published my Emacs configuration to GitHub. You can read it here. I hope you will find some useful things there. Enjoy!Read more
Lesser known Clojure: letfn form
Sometimes it’s useful to declare functions for a local scope only. Typically this can be achieved by using
let form. Let’s look at such example:
Clojure: JSON request with http.async.client library
Lately I was writing Clojure code that needed to do the
POST request to the external service. Additional requirement was that this request should use
JSON as a format of a data in the body. I was using http.async.client library for doing my network communication. Because I couldn’t find any example of such request I’ve spent some time before I was done. To help you, I will post my solution.