SICP Study

3.2 The Environment Model of Evaluation

To apply a compound procedure to arguments, evaluate the body of the procedure with each formal parameter replaced by the corresponding argument. (Section 3.2)

3.2.1 The Rules for Evaluation

3.2.2 Applying Simple Procedures

(define (square x) (* x x))
(define (sum-of-squares x y) (+ (square x) (square y)))
(define (f a) (sum-of-squares (+ a 1) (* a 2)))

3.2.3 Frames as the Repository of Local State

(define (make-withdraw balance)
  (lambda (amount)
    (if (>= balance amount)
        (begin (set! balance (- balance amount))
               balance)
        "Insufficient funds")))

3.2.4 Internal Definitions