There clojure.set/select :
(clojure.set/select set-of-maps #(-> % :age (= 3)))
And similarly with name and "Reagan" . The return value in this case will be a set.
You can also use filter without any special preparations, since filter calls seq in its collection argument (edit: as ffriend already described when I typed this):
(filter
Here the return value will be lazy.
If you know that there will be only one element in the set that matches your predicate, some will be more efficient (since it will not process any additional elements after finding a match):
(some #(if (-> % :age (= 3)) %) set-of-maps)
The return value here would be a suitable element.
source share