clojuredesign-podcast

Discussions around the Functional Design in Clojure podcast - https://clojuredesign.club/
nate 2020-07-03T17:57:56.091700Z

This week, we're composers. https://clojuredesign.club/episode/079-compose-thyself/

lodin 2020-07-03T19:01:00.098100Z

Maybe I missed it, but in the episode on partial, I think you missed one important aspect. One is that partial f ... is not equivalent to #(f ... %) (even if f is unary). If ... is impure, then it will only be evaluated once for partial, but upon every call for #(). If it is pure, then you need to decide whether you want the argument recomputed or not. So while I usually use #() I end up using partial specifically when I have a non-trivial expression that I want to fix as the first argument, instead of doing (let [x ...] #(f x %)). The other big reason for me is when I have nested lambdas, since #() doesn't nest, and I for some reason don't want to introduce a fn form.

neumann 2020-07-03T19:23:28.099500Z

@lodin.johan Ah yes, we did not talk about when arguments are evaluated. I like your point about binding the result of the computation vs re-computing every time.

neumann 2020-07-03T19:24:52.101Z

In today's episode, we do bring up the issue of nested #(). I've been programming in Clojure for 6 years now and I still trip over that from time to time!