4.28 Exercise 4.28
One of the changes we made to the evaluator was to make eval use actual-value instead of eval on the operator when evaluating an application. This is necessary, as the book says, because the operator needs to be forced before being passed to the apply function before it can be distinguished as a primitive or compound procedure and correctly applied. A simple test case is as follows:
(define (f g x) (g x)) (g + 1)
+ will be a thunk when passed to the apply method, and therefore both primitive-procedure? and compound-procedure? will be false, causing an error as it does not appear to be a procedure at all.