Function: BEST

Documentation

finds the 'best' object in lst according to fn

Source

(defun best (fn lst)
  "finds the 'best' object in lst according to fn"
  (if (null lst)
      nil
      (let ((wins (car lst)))
	(dolist (obj (cdr lst))
	  (if (funcall fn obj wins)
	      (setq wins obj)))
	wins)))
Source Context