SICP Exercise 4.12 abstractions for traversing the environment structure
Exercise 4.12. The procedures set-variable-value!, define-variable!, 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.
SOLUTION
The code and tests are here. The abstractions that capture the common patterns in traversing the environment structure can be found in the new procedures named 'find-variable-position-in-env' and 'find-variable-position-in-frame'.
Comments
Post a Comment