]> git.rkrishnan.org Git - sicp.git/blob - src/sicp/ex2_59.clj
solutions to 3.64, 3.65, 3.66, 3.67, 3.68 and 3.69
[sicp.git] / src / sicp / ex2_59.clj
1 (ns sicp.ex2_59
2   (:use [clojure.test]
3         [sicp.ch2_3]))
4
5 (defn union-set [set1 set2]
6   (cond (empty? set1) set2
7         (element-of-set? (first set1) set2) (union-set (rest set1) set2)
8         :else (cons (first set1) set2)))