Exercise 4.17: Draw diagrams of the environment
in effect when evaluating the expression ⟨e3⟩ in the procedure in the
text, comparing how this will be structured when definitions are interpreted
sequentially with how it will be structured if definitions are scanned out as
described. Why is there an extra frame in the transformed program? Explain
why this difference in environment structure can never make a difference in the
behavior of a correct program. Design a way to make the interpreter implement
the “simultaneous” scope rule for internal definitions without constructing
the extra frame.
练习 4.17:画出在对正文中过程里的表达式 ⟨e3⟩ 求值时生效的环境图,比较按顺序解释定义时的环境结构与按上述方式扫描出定义时的环境结构。为什么变换后的程序中会多出一个框架?请解释为何这种环境结构的差异永远不会影响正确程序的行为。设计一种让解释器实现内部定义"同时"作用域规则的方式,而不构造额外的框架。