Code Review

Compare your solutions

    #| BEGIN (Write your solution here) |#
(define (make-monitored proc)
  (let ((count 0))
    (define (how-many-calls?)
      count)
    (define (reset-count)
      (begin (set! count 0)
             count))
    (define (call arg)
      (begin (set! count (+ count 1))
             (proc arg)))
    (define (dispatch arg)
      (cond ((eq? arg 'how-many-calls?)
             (how-many-calls?))
            ((eq? arg 'reset-count)
             (reset-count))
            (else (call arg))))
    dispatch))
#| END |#