You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sicp-all-tasks/sicp/5_002e32

19 lines
866 B

Exercise 5.32: Using the preserving
mechanism, the compiler will avoid saving and restoring env around the
evaluation of the operator of a combination in the case where the operator is a
symbol. We could also build such optimizations into the evaluator. Indeed,
the explicit-control evaluator of 5.4 already performs a similar
optimization, by treating combinations with no operands as a special case.
Extend the explicit-control evaluator to recognize as a separate class of
expressions combinations whose operator is a symbol, and to take advantage of
this fact in evaluating such expressions.
Alyssa P. Hacker suggests that by extending the evaluator to recognize more and
more special cases we could incorporate all the compiler’s optimizations, and
that this would eliminate the advantage of compilation altogether. What do you
think of this idea?