SICP Practice

Practice 3.1

(define (make-accumulator n)
  (lambda (x)
    (set! n (+ x n))))

(define A (make-accumulator 5))

(A 1)  ; 6
(A 2)  ; 8
(A 3)  ; 11