From: Ramakrishnan Muthukrishnan Date: Tue, 7 Sep 2010 10:55:41 +0000 (+0530) Subject: solution to 2.59 X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/bcase/status?a=commitdiff_plain;h=d6b1104927207a799f7f80d3691f3aa41b7cd1c3;p=sicp.git solution to 2.59 --- diff --git a/src/sicp/ex2_59.clj b/src/sicp/ex2_59.clj new file mode 100644 index 0000000..3c72869 --- /dev/null +++ b/src/sicp/ex2_59.clj @@ -0,0 +1,8 @@ +(ns sicp.ex2_59 + (:use [clojure.test] + [sicp.ch2_3])) + +(defn union-set [set1 set2] + (cond (empty? set1) set2 + (element-of-set? (first set1) set2) (union-set (rest set1) set2) + :else (cons (first set1) set2))) \ No newline at end of file