Note: this wiki is now retired and will no longer be updated!

The static final versions of the pages are left as a convenience for readers. Note that meta-pages such as "discussion," "history," etc., will not work.

SICP exercise 1.34

From Drewiki
Jump to: navigation, search


Suppose we define the procedure:

(define (f g) 
  (g 2))

Then we have

(f square)
(f (lambda (z) (* z (+ z 1)))) 

What happens if we (perversely) ask the interpreter to evaluate the combination (f f)? Explain.


Let's use the substitution model to illustrate:

(f f)
(f 2)
(2 2)

The combination (2 2) is an error, since 2 is neither a primitive nor a compound procedure.

Personal tools