With Maps of Mapsλ︎
Note Define a collection of star-wars characters using a map of maps. Each character should have an name that they are typically referred to, along with their fullname and skill
Now we can refer to the characters using keywords. Using the get function we return all the information about Luke
By wrapping the get function around our first, we can get a specific piece of information about Luke
There is also the get-in function that makes the syntax a little easier to read
Or you can get really concise by just talking to the map directly
And finally we can also use the threading macro to minimise our code further
Note* Create a slightly data structure holding data around several developer events. Each event should have a website address, event type, number of attendees, call for papers.
This data structure is just a map, with each key being the unique name of the developer event.
The details of each event (the value to go with the event name key) is itself a map as there are several pieces of data associated with each event name. So we have a map where each value is itself a map.
Call the data structure and see what it evaluates too, it should not be a surprise
We can ask for the value of a specific key, and just that value is returned
In our example, the value returned from the :devoxxuk key is also a map, so we can ask for a specific part of that map value by again using its key