From b2961f1fca5434d0886f3431db3653b719bd3481 Mon Sep 17 00:00:00 2001 From: Aaron Bedra Date: Sat, 6 Feb 2010 18:43:06 -0500 Subject: [PATCH] adding about sets --- koans/about_sets.clj | 16 ++++++++++++++++ koans/path_to_enlightenment.clj | 1 + 2 files changed, 17 insertions(+) create mode 100644 koans/about_sets.clj diff --git a/koans/about_sets.clj b/koans/about_sets.clj new file mode 100644 index 0000000..ccf7a57 --- /dev/null +++ b/koans/about_sets.clj @@ -0,0 +1,16 @@ +(meditations + "Sets are another important data structure in clojure" + (= #{} (set nil)) + + "Remember that a set is a 'set'" + (= __ (set '(1 1 2 2 3 3 4 4 5 5))) + + "You can ask clojure for the union of two sets" + (= __ (clojure.set/union #{1 2 3 4} #{2 3 5})) + + "And also the intersection" + (= __ (clojure.set/intersection #{1 2 3 4} #{2 3 5})) + + "But don't forget about the difference" + (= __ (clojure.set/difference #{1 2 3 4 5} #{2 3 5}))) + diff --git a/koans/path_to_enlightenment.clj b/koans/path_to_enlightenment.clj index b122c1a..e8b9d62 100644 --- a/koans/path_to_enlightenment.clj +++ b/koans/path_to_enlightenment.clj @@ -14,4 +14,5 @@ (load "about_equalities") (load "about_vectors") +(load "about_sets") (println "You have acheived clojure enlightenment. Namaste.") \ No newline at end of file