;; Figure 6.1: Utility functions (defun single? (lst) (and (consp lst) (null (cdr lst))));is it a cons cell that has an nil cdr (defun append1 (lst obj) (append lst (list obj))); add obj to the end of the list (defun map-int (fn n) (let ((acc nil));call fn with 0 - n and add in a list (dotimes (i n) (push (funcall fn i) acc)) (nreverse acc)));flip the list so its logical (defun filter (fn lst) (let ((acc nil)) (dolist (x lst) (let ((val (funcall fn x))) (if val (push val acc)))) (nreverse acc))) (defun most (fn lst) (if (null lst) nil (let* ((wins (car lst)) (max (funcall fn wins))) (dolist (obj (cdr lst)) (let ((score (funcall fn obj))) (when (> score max) (setf wins obj max score)))) wins)))