From 47d4342314c018afc5e606eae851d2bf6b06fb59 Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Thu, 4 Nov 2010 08:01:34 -0500 Subject: [PATCH] Show not= and collection equality. --- src/koans/equalities.clj | 5 ++++- src/koans/vectors.clj | 5 ++++- src/path_to_answer_sheet.clj | 6 ++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/koans/equalities.clj b/src/koans/equalities.clj index 9285621..025bec7 100644 --- a/src/koans/equalities.clj +++ b/src/koans/equalities.clj @@ -15,4 +15,7 @@ (= __ (= 2 2.0)) "But a looser equality is also possible" - (== 2.0 2 __)) + (== 2.0 2 __) + + "When things cannot be equal, they must be different" + (not= nil __)) diff --git a/src/koans/vectors.clj b/src/koans/vectors.clj index b1b97ea..dcf8337 100644 --- a/src/koans/vectors.clj +++ b/src/koans/vectors.clj @@ -27,4 +27,7 @@ (= __ (nth [:peanut :butter :and :jelly] 3)) "You can also slice a vector" - (= __ (subvec [:peanut :butter :and :jelly] 1 3))) + (= __ (subvec [:peanut :butter :and :jelly] 1 3)) + + "Equality with collections is in terms of values" + (___ (list 1 2 3) (vector 1 2 3))) diff --git a/src/path_to_answer_sheet.clj b/src/path_to_answer_sheet.clj index f8dd562..eacf250 100644 --- a/src/path_to_answer_sheet.clj +++ b/src/path_to_answer_sheet.clj @@ -10,7 +10,8 @@ 5 4/2 false - 6/3]} + 6/3 + 3]} "lists" {"__" ["1 2 3 4 5" 1 [2 3 4 5] @@ -30,7 +31,8 @@ :peanut :jelly :jelly - [:butter :and]]} + [:butter :and]] + "___" ["="]} "sets" {"__" [3 #{1 2 3 4 5} #{1 2 3 4 5}