灯下 登录
计算机科学 / SICP / 3.1.1 Local State Variables

Exercise 3.4 · 习题

Exercise 3.4: Modify the make-account

procedure of Exercise 3.3 by adding another local state variable so that,

if an account is accessed more than seven consecutive times with an incorrect

password, it invokes the procedure call-the-cops.

练习 3.4:修改练习 3.3 中的 make-account 过程,添加另一个局部状态变量,使得:如果一个账户连续超过七次以错误密码被访问,它就调用过程 call-the-cops。