Allow nil as an answer.
This commit is contained in:
parent
1648d9e94a
commit
f29e547f2a
@ -24,6 +24,9 @@
|
|||||||
(= __ ({2006 "Torino" 2010 "Vancouver" 2014 "Sochi"} 2010))
|
(= __ ({2006 "Torino" 2010 "Vancouver" 2014 "Sochi"} 2010))
|
||||||
|
|
||||||
"You may not be able to find an entry for a key"
|
"You may not be able to find an entry for a key"
|
||||||
|
(= __ (get {:a 1 :b 2} :c))
|
||||||
|
|
||||||
|
"But you can provide your own default"
|
||||||
(= __ (get {:a 1 :b 2} :c :key-not-found))
|
(= __ (get {:a 1 :b 2} :c :key-not-found))
|
||||||
|
|
||||||
"You can find out if a key is present"
|
"You can find out if a key is present"
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
1
|
1
|
||||||
1
|
1
|
||||||
"Vancouver"
|
"Vancouver"
|
||||||
|
nil
|
||||||
:key-not-found
|
:key-not-found
|
||||||
true
|
true
|
||||||
false
|
false
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
(:require [clojure.set]
|
(:require [clojure.set]
|
||||||
[clojure.string]))
|
[clojure.string]))
|
||||||
|
|
||||||
(def __ nil)
|
(def __ :fill-in-the-blank)
|
||||||
(def ___ (fn [& args] nil))
|
(def ___ (fn [& args] __))
|
||||||
|
|
||||||
(defmacro meditations [& forms]
|
(defmacro meditations [& forms]
|
||||||
(let [pairs (partition 2 forms)]
|
(let [pairs (partition 2 forms)]
|
||||||
|
Loading…
Reference in New Issue
Block a user