I have been diving into the functional language Clojure recently and I could not quite remember how to destructure maps. The syntax kept giving me fits so I started down long testing session and wanted to share my finding.
First lets load up some data to use as test data. We will use this for the rest of the examples.
My first run at breaking this data apart was to use the keys directive for each map that the data contained. It ended up like this. You can also see the :as directive which if you execute the gist and view the output it simply maintains the whole structure that was passed in.
The next phase came after reading the Clojure documentation about special forms in destructing maps.
Following some of that advice it became
Notice that we can prefixed map keys as of Clojure 1.6.
Finally you can also use auto resolved keywords in Clojure 1.6. I personally like the prefixed map keys compared to the auto resolved just because it gives a tad more context.