diff --git a/src/koans/maps.clj b/src/koans/maps.clj index 205c022..bbaeeab 100644 --- a/src/koans/maps.clj +++ b/src/koans/maps.clj @@ -24,6 +24,9 @@ (= __ ({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)) + + "But you can provide your own default" (= __ (get {:a 1 :b 2} :c :key-not-found)) "You can find out if a key is present" diff --git a/src/path_to_answer_sheet.clj b/src/path_to_answer_sheet.clj index 40f6632..63844ad 100644 --- a/src/path_to_answer_sheet.clj +++ b/src/path_to_answer_sheet.clj @@ -44,6 +44,7 @@ 1 1 "Vancouver" + nil :key-not-found true false diff --git a/src/path_to_enlightenment.clj b/src/path_to_enlightenment.clj index a65f9ed..9941bae 100644 --- a/src/path_to_enlightenment.clj +++ b/src/path_to_enlightenment.clj @@ -3,8 +3,8 @@ (:require [clojure.set] [clojure.string])) -(def __ nil) -(def ___ (fn [& args] nil)) +(def __ :fill-in-the-blank) +(def ___ (fn [& args] __)) (defmacro meditations [& forms] (let [pairs (partition 2 forms)]