failure of the substitution model
consider
- (define x 100)
- (define (down i) (begin (set! x (- x i)) x))
- (down 1) ==> 99
- (down 1) ==> 98
loss of referential transparency
- so far, evaluation of the same expression always gave the same result
- this is referential transparency
- no longer true
can’t use substitution model
- suppose we substituted 100 for x in the definition of down:
(define down (begin (set! 100 99) 100))
- makes no sense at all
- not enough just to track values associated with variables: need notion of place