diff options
-rw-r--r-- | src/clojure/contrib/fnmap/PersistentFnMap.clj | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/clojure/contrib/fnmap/PersistentFnMap.clj b/src/clojure/contrib/fnmap/PersistentFnMap.clj index c340c74e..dfa3af64 100644 --- a/src/clojure/contrib/fnmap/PersistentFnMap.clj +++ b/src/clojure/contrib/fnmap/PersistentFnMap.clj @@ -42,9 +42,12 @@ (defn- -entryAt [this key] (clojure.lang.MapEntry. key ((::getter (. this state)) (. this state) key))) - -(defn -valAt [this key] - ((::getter (. this state)) (. this state) key)) +(defn -valAt + ([this key] + ((::getter (. this state)) (. this state) key)) + ([this key default] + (or ((::getter (. this state)) (. this state) key) + default))) ;; Iterable |