SICP Exercise 3.11

来源:互联网 发布:游戏机实用技术 知乎 编辑:程序博客网 时间:2024/05/17 21:40

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

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


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


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


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

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