;; substitution.scm ;; ;; an example of our previous "substitution model" of evalution ;; ;; (define (f x) (2 * x)) (define (g y) (let ((z (* 2 y)) (+ (f z) (f y))))) (g 10) ;; -- Here's what the substitution model looks like ... ;; plugging in by hand. ;; ;; (g 10) ;; ;; (let ((z (* 2 10)) ;; substitute definition of g with y => 10 ;; (+ (f z) ;; (f 10))))) ;; ;; (+ (f 20) ;; substitute into (let ..) value of z ;; (f 10)) ;; ;; (+ (* 2 20) ;; subsitute definition of f with x => 20 or 10 ;; (* 2 10)) ;; ;;