Exercise1-33 <---> Exercise1-35

Exercise 1.34

Suppose we define the procedure

(define (f g)
  (g 2))

Then we have

(f square)
4

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

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


Scheme solution:

The interpreter will raise an error, as the expression reduces to:

(2 2)

which tries to evaluate the non-existent procedure 2 with the argument 2.

Exercise1-33 <---> Exercise1-35


Comments


:) :)) :( ;) :\ |) X-( B) Markup

Exercise1-34 (last edited 2008-05-11 11:36:16 by localhost)