4. Mapping and Filtering
Activity 4.01: Using map and filter to Report Summary Information
Solution:
- To start, set up a simple framework using the
->>
threading macro:(defn max-value-by-status [field status users] (->> users ;; code will go here ))
This defines the fundamental structure of our function, which we can sum up as follows: start with
users
and send it through a series of transformations. - The first of these transformations will be to filter out all the users that don't have the status we are looking for. We'll use
filter
for that, naturally, and we'll include a...