灯下 登录
计算机科学 / SICP / 4.1.3 Evaluator Data Structures

Exercise 4.12 · 习题

Exercise 4.12: The procedures

define-variable!, set-variable-value! and

lookup-variable-value can be expressed in terms of more abstract

procedures for traversing the environment structure. Define abstractions that

capture the common patterns and redefine the three procedures in terms of these

abstractions.

练习 4.12:过程 define-variable!、set-variable-value! 和 lookup-variable-value 可以用遍历环境结构的更抽象的过程来表达。请定义能捕捉公共模式的抽象,并用这些抽象重新定义上述三个过程。