]> git.rkrishnan.org Git - sicp.git/blob - src/sicp/ex1_42.clj
solution to 1.42
[sicp.git] / src / sicp / ex1_42.clj
1 (ns sicp.ex1_42
2   (:use [clojure.contrib test-is]
3         [sicp utils]
4         [sicp ch1_3]))
5
6 (defn compose [f g]
7   (fn [x] (f (g x))))
8
9 (comment
10 ((compose square inc) 6)
11 ;;=> 49
12 ((compose square square) 2)
13 ;;=> 16
14  )