SICP Exercise 3.11

1,The result of  (define acc (make-account 50)):

SICP Exercise 3.11_第1张图片

2, Environments when evaluating ((acc 'deposit) 40):

SICP Exercise 3.11_第2张图片

3, Result of ((acc 'deposit) 40):

SICP Exercise 3.11_第3张图片

4, Environments when evaluating ((acc 'withdraw) 60):

SICP Exercise 3.11_第4张图片

5,The result of ((define acc2 (make-account 100)):

SICP Exercise 3.11_第5张图片

The two account kept local states distinct by using different environment. Note: I assumed that the code is shared. 

你可能感兴趣的:(SICP Exercise 3.11)