【SICP练习】118 练习3.45

练习3-45原文

Exercise 3.45. Louis Reasoner thinks our bank-account system is unnecessarily complex and error-prone now that deposits and withdrawals aren’t automatically serialized. He suggests that make-accountand-serializer should have exported the serializer (for use by such procedures as serializedexchange) in addition to (rather than instead of) using it to serialize accounts and deposits as makeaccount did. He proposes to redefine accounts as follows:

amount) balance (- balance amount))balance)amount)(set! balance (+ balance amount))balance)))) m ‘deposit) m ‘serializer) balance-serializer)m))))dispatch))

Then deposits are handled as with the original make-account:

‘deposit) amount))

Explain what is wrong with Louis’s reasoning. In particular, consider what happens when serializedexchange is called.

代码

临时发现有误,,待完成。

为使本文得到斧正和提问,转载请注明出处:

邮箱及Skype:nomasp@outlook.com Facebook:https://www.facebook.com/yuwang.ke CSDN博客: 新浪微博:

做对的事情比把事情做对重要。

【SICP练习】118 练习3.45

相关文章:

你感兴趣的文章:

标签云: