(define (locmax f a b)
  (accumulate
    max                         ;combiner
    (f a)                       ;null-value
    (lambda (x) x)              ;term
    a                           ;a
    (lambda (x) (+ x 1))        ;next
    b))                         ;b