diff --git a/src/koans/equalities.clj b/src/koans/equalities.clj index 970f692..cc60740 100644 --- a/src/koans/equalities.clj +++ b/src/koans/equalities.clj @@ -1,9 +1,9 @@ (meditations - "We shall contemplate truth by testing reality, via equality." - (= __ true) + "We shall contemplate truth by testing reality, via equality." + (= __ true) - "To understand reality, we must compare our expectations against reality." - (= __ (+ 1 1)) + "To understand reality, we must compare our expectations against reality." + (= __ (+ 1 1)) - "You can test equality of many things" - (= (+ 3 4) __ (+ 2 __))) + "You can test equality of many things" + (= (+ 3 4) __ (+ 2 __))) diff --git a/src/koans/sets.clj b/src/koans/sets.clj index ccf7a57..51bffc6 100644 --- a/src/koans/sets.clj +++ b/src/koans/sets.clj @@ -1,16 +1,16 @@ (meditations - "Sets are another important data structure in clojure" - (= #{} (set nil)) + "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))) + "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})) + "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})) + "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}))) + "But don't forget about the difference" + (= __ (clojure.set/difference #{1 2 3 4 5} #{2 3 5}))) diff --git a/src/koans/vectors.clj b/src/koans/vectors.clj index 1409921..bcdedb3 100644 --- a/src/koans/vectors.clj +++ b/src/koans/vectors.clj @@ -1,27 +1,27 @@ (meditations - "You can use vectors in clojure to create an 'Array' like structure" - (= __ (.size (vec nil))) + "You can use vectors in clojure to create an 'Array' like structure" + (= __ (.size (vec nil))) - "You can create a vector in two ways" - (= [] (vec nil)) + "You can create a vector in two ways" + (= [] (vec nil)) - "And populate it in either of these ways" - (= [1] (vec '(1))) - - "But you can populate it with any number of elements at once" - (= [1 __] (vec '(1 2))) - - "And add to it as well" - (= __ (conj (vec nil) 333)) + "And populate it in either of these ways" + (= [1] (vec '(1))) - "You can get the first element of a vector like so" - (= :peanut (first [:peanut :butter :and :jelly])) + "But you can populate it with any number of elements at once" + (= [1 __] (vec '(1 2))) - "And the last in a similar fashion" - (= __ (last [:peanut :butter :and :jelly])) + "And add to it as well" + (= __ (conj (vec nil) 333)) - "Or any index if you wish" - (= __ (nth [:peanut :butter :and :jelly] 3)) + "You can get the first element of a vector like so" + (= :peanut (first [:peanut :butter :and :jelly])) - "You can also slice a vector" - (= __ (subvec [:peanut :butter :and :jelly] 1 3))) \ No newline at end of file + "And the last in a similar fashion" + (= __ (last [:peanut :butter :and :jelly])) + + "Or any index if you wish" + (= __ (nth [:peanut :butter :and :jelly] 3)) + + "You can also slice a vector" + (= __ (subvec [:peanut :butter :and :jelly] 1 3)))