sicp-ex-1.34



<< Previous exercise (1.33) | sicp-solutions | Next exercise (1.35) >>


First invocation of f will attempt to apply its argument (which is f) to 2. This second invocation will attempt to apply its argument (which is 2) to 2, resulting in error.

 (f f) 
 (f 2) 
 (2 2) 
 ; Error 
 ; MIT Scheme reports: The object 2 is not applicable. 

Note that both substitution models, applicative-order evaluation and normal-order evaluation, will lead to the same expansion.