Hi, I'm Aditya Athalye. I make, learn, teach here.

submited by
Style Pass
2025-08-08 11:00:05

Because I realised thinking like this is not obvious to Clojure newcomers, especially those having non-FP first languages. Because I was there too, all those moons ago!

Someone working through the "Brave Clojure" book asked #beginners in the Clojurians Zulip chat, for help about implementing comp "in their own words". Useful help followed in the Zulip thread, of course. I was late to the party. Of course. But when has that ever stopped anyone on the Internet from generating a wall of text?

Having done so, I realised a bunch of ideas have to coalesce in the Clojure learner's mind to truly See the picture, and I certainly did not See it for a long time:

So, we essentially need to handle zero, one, and two argument cases, and figure out how to use that solution to handle the fully general n argument case.

If this looks freaky, fear not… It took me a long time to figure out how to think like that "natually". And it still freaks me out that this kind of thing "just works". Give it time, it will come to you.

Leave a Comment
Related Posts