Clojure Assoc-in, Part 2
In a previous post, Clojure Assoc-in, I discussed adding items to a Clojure nested map. I came up with an alternative solution.
Let’s define the original map (again):
To recap, we want to add the following to the above map, under the :info
key:
Here’s the previous solution:
And now, the updated one (drumroll please!):
Ok, I know, not terribly exciting, but it’s a little easier to understand (at least for me). And yes, we are using a thread-first macro like we discussed in a previous post on threading macros.
In Closing…
I am still not happy with this solution, and I’m sure there is still a more elegant way to solve this one. Stay tuned!