University of Washington • CSE583 • D. Notkin © 2000
54
Example
l(define x 100)
(define bar (lambda (x) (foo 1 2))
(define foo (lambda (x y)
  (let ((w (+ y 1)))
    (let ((y w))
      (+ x y)))))
lUsing lexical scoping, (bar 5) ® 103
lUsing dynamic scoping, (bar 5) ® 4
–The call stack is followed to find the binding of the variables