3 [clojure.contrib trace test-is]))
5 ;; exercise 1.3: Define a procedure that takes three numbers as
6 ;; arguments and returns the sum of the squares of
7 ;; the two larger numbers.
9 (cond (> b a) (sort3 b a c)
13 (defn sum-of-sq-of-two-largest [a b c]
14 (apply sum-of-squares (take 2 (sort3 a b c))))
16 ;; well, I cheated above. Let me use only the constructs introduced
17 ;; so far in the book. (follows after the sicp meetup #2 on 28/mar/2010.
18 (defn sum-of-square-of-two-largest [a b c]
21 (sum-of-squares a b) ; a > b > c
25 (sum-of-squares b c))))