(clj 10) The mapify function of (clj 9) revisited
In my previous Clojure post I covered the code example at the end of Chapter 4 of “Clojure for the Brave and True”. Or rather, I focused on a single function in the example, called
mapify, and described how I figured out what it does. At the end of that post I shared my disappointment:
Having done all this work (and writing) I can’t help but feel a bit disappointed. In the end, the function does not seem to do a lot.
And I shared a Python version of that same function, claiming that it basically does the same thing1.
However, less than a week after publishing the post, I got a very kind email by someone named Martin. And “in defence of clojure and to maybe reduce your disappointment” Martin pointed out the two versions are not as equivalent as I claimed, because the Clojure version is more general than the Python version. So I looked at the two version again and the way they are different turned out to be quite interesting - interesting enough to write a follow-up post.