Blob
1 (defun accumulator (combiner null-value term a next b)2 (if (> a b)3 null-value4 (funcall combiner5 (funcall term a)6 (accumulator combiner null-value term (funcall next a) next b))))7 (defun sum (term a next b)8 (accumulator #'+ 0 term a next b))9 (defun accumulator-iter (combiner null-value term a next b)10 (defun iter (a result)11 (if (> a b)12 result13 (iter (funcall next a)14 (funcall combiner (funcall term a) result))))