Avoid nil answer, but allow it to fail if it's wrong. Fixes #6.

This commit is contained in:
Colin Jones
2011-02-03 12:00:03 -06:00
parent 9c947e7ac7
commit 1648d9e94a
3 changed files with 22 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
(meditations
"Lists can be expressed by function or a quoted form"
(= '(__) (list 1 2 3 4 5))
(= '(__ __ __ __ __) (list 1 2 3 4 5))
"They are Clojure seqs (sequences), so they allow access to the first"
(= __ (first '(1 2 3 4 5)))

View File

@@ -24,7 +24,7 @@
(= __ ({2006 "Torino" 2010 "Vancouver" 2014 "Sochi"} 2010))
"You may not be able to find an entry for a key"
(= __ (get {:a 1 :b 2} :c))
(= __ (get {:a 1 :b 2} :c :key-not-found))
"You can find out if a key is present"
(= __ (contains? {:a nil :b nil} :b))