Fork me on GitHub
#code-reviews
<
2015-07-30
>
ul07:07:31

Hi, clojurians! I suspect that this tiny wrapper should have even more concise and clojury form:

(defn inject [g]
  (fn [f]
    (fn [e]
      (g e)
      (when f (f e)))))

ul07:07:47

Any ideas?

potetm14:07:06

@ul: So g is side-affecty, like a logging statement?

potetm14:07:55

I honestly don’t see anything wrong with how it is. I wouldn’t something like that for every application, but I could see it being useful for certain things.