灯下 登录
计算机科学 / SICP / 5.5.5 An Example of Compiled Code

Exercise 5.36 · 习题

Exercise 5.36: What order of evaluation does our

compiler produce for operands of a combination? Is it left-to-right,

right-to-left, or some other order? Where in the compiler is this order

determined? Modify the compiler so that it produces some other order of

evaluation. (See the discussion of order of evaluation for the

explicit-control evaluator in 5.4.1.) How does changing the

order of operand evaluation affect the efficiency of the code that constructs

the argument list?

练习 5.36:我们的编译器对组合式的运算对象采用何种求值顺序?是从左到右、从右到左,还是某种其他顺序?编译器在哪里确定这一顺序?修改编译器,使其产生某种其他求值顺序。(参见 5.4.1 节中关于显式控制求值器求值顺序的讨论。)改变运算对象的求值顺序会对构造实参表 (argument list) 的代码效率产生什么影响?