(defun most2 (fn lst) ;this gets the largest value that fn generates (if (null lst) (values nil nil);if lst is mt, return nil nil (loop with wins = (car lst);for each car in the list with max = (funcall fn wins);get the value of fn for obj in (cdr lst) ;for each obj in the remainder of the ls for score = (funcall fn obj);score the obj when (> score max);if the new obj is greater than the old score, set the wins and max to the current element and score do (setf wins obj max score) finally (return (values wins max)))));after lst is processed, return the wins and max. (defun num-year2 (n) (if (< n 0) (loop for y downfrom (- yzero 1) ;if n is less than 0, loop thru y until 0. until (<= d n);d is 0. sum (- (year-days y)) into d; put the difference of year-days y into d. finally (return (values (+ y 1) (- n d)))); returns the y + 1, and difference of n and d. (loop with prev = 0;else, if n >= 0 for y from yzero; for values of y from zero, until (> d n); until d(which starts as zero) is greater than n do (setf prev d); set prev to be the previous d sum (year-days y) into d ;put the day count into d finally (return (values (- y 1); finally, return y minus 1, and n minus the previous d. (- n prev)))))) (deftest test-loop () (check (= (car (cdr (multiple-value-list (most2 #'length '((a b) (a b c) (a)))))) 3);testing most2 using length as the lookup value (= (car (cdr (multiple-value-list (num-year2 2001)))) 174);testing num-year (= (car (multiple-value-list (num-year2 2001))) 2005)));and again.