(define (f-acc pred? op id term a next b)
  (cond ((> a b) id)
        ((pred? a)
         (op (term a)
             (f-acc pred? op id term (next a) next b)))
        (else (f-acc pred? op id term (next a) next b))))

(f-acc (lambda (x) (= (remainder x 3) 0))
	+
	0
	(lambda (x) (* x x))
	1
	(lambda (x) (+ x 1))
	10)