by arb · 17y ago · 0 comments
(Σ (fn [i] (* (p i) (log (p i)))) x)
The tradeoff with your macro version is that when you want to leverage Σ as a first-class function (say, with comp or partial), you will end up with #() or (fn..) in the calling code. You can't escape it -- it's a natural way to write functional Lisp code.It's no less readable than the rest of Clojure's API. You can reasonably expect a Clojure user to understand functions as arguments.
No comments yet.