If I have a sequence of records defined (defrecord Person [name age]) and I want to get a record about a person with the maximum age, is there an easier way to do this than
(reduce #(if (> (:age %1) (:age %2)) %1 %2) people)
This is the only way I have guessed to do this so far, but it looks like it should be a fairly common script that should be built into library functions that make it simpler and / or more general.
clojure
lobsterism
source share