;;Functions to help test-recursion (defun recursive-sum (l) (if (null l); if l is mt, return 0 0 (if (not (numberp (car l))) ;if car of l is not a number, return nil nil (+ (car l) (recursive-sum (cdr l)))))); return the value of the car + the value of sum on the cdr of l. (defun counta (lst count) (if (null lst) count; if l is mt, return the count (if (eql (car lst) 'a); if car of lst is a, call counta with the cdr of the lst, and incf count (counta (cdr lst) (+ count 1)) (counta (cdr lst) count))));else, call counta with the cdr of the lst with the same count ;;Chapter 2, Test 6, Pg 16 (deftest test-recursion () (check (equal (recursive-sum (list 1 2 3 4 5)) 15);tests recursive sum with a lst of numbers (equal (recursive-sum (list `a `b `c)) nil);tests the error checking on recursive sum (= 3 (counta (list `a `b `c `d `a `a) 0));added by Jim, counts the number of a's in lst. ))