finds the 'highest' value in lst according to fn. Returns obj and score
(defun most (fn lst &key (test #'>))
"finds the 'highest' value in lst according to fn.
Returns obj and score"
(if (null lst)
(values nil nil)
(let* ((wins (car lst))
(max (funcall fn wins)))
(dolist (obj lst)
(let ((score (funcall fn obj)))
(when (funcall test score max)
(setq wins obj
max score))))
(values wins max))))Source Context