Open phrohdoh opened 3 years ago
See https://github.com/phrohdoh/cljrs/commit/ceb3f9eeed12c6987ff8e41ddcf9b260674d639e for changes building on top of this PR to support map and keyword application default values:
({:k :v} :x) ;; => nil
({:k :v} :x :not-found) ;; => :not-found
(:x {:k :v}) ;; => nil
(:x {:k :v} :not-found) ;; => :not-found
https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/get
Instead of adding a
not_found: Option<&Rc<Value>
toIPersistentMap::get
(to be threaded through all nested calls and a seemingly-arbitrary default to::get
callsites) I opted to continue the*_with_*
convention; creating aget_with_default
function.If merged, this would fix https://github.com/clojure-rs/ClojureRS/issues/86 (for maps, but I, perhaps incorrectly, recall reading that
get
can be applied to non-maps, though the linked docs certainly do not suggest so).