3 ms·
Clojure (and I'm sure other lisps and programming languages) have a nice solution to this, the `->` macro ("threading") You'd do something like: (save (tran
by diggan 3y ago
Clojure (and I'm sure other lisps and programming languages) have a nice solution to this, the `->` macro ("threading")
You'd do something like:
(save (transform (fetch))) ;; calls fetch, then transform, then save
(-> (fetch)
(transform)
(save))
Not that the non-threading version was hard to read, but once the function names start to be a bit longer and involve arguments, the threading version tends to be a lot easier to read.