Solution to SICP Exercise 1.41

Structure and Interpretation of Computer Programs

Solution to Exercise 1.41:

(define (double f)
(lambda (x) (f (f x))))

Output:

> (define (inc x) (+ x 1))
> (((double (double double)) inc) 5)
21

Advertisements