clojure-dev 2026-10-26

thinking about how I'd use the new :missing and wondering whether it would make sense to use a non-nil value in the map so {:a true-ish-something} rather than {:a nil}? say I want to use the map for control flow then with nil a typical clojure (if (:a missing) ...) doesn't work since its nil, so it would need to be (if (contains? missing :a) ...). of course fine, just have to remember to treat this differently. haven't dug in that much yet, just curious why nil is the choice here? might be misunderstanding the purpose of :missing entirely too.

my guess is that if :missing were treated like a predicate, it would give false positives for nested data

(let [{{:keys! [c]} :nested
         :missing     missing}
        {:a 1 :nested {}}]
    (:nested missing))
the :nested key isn't missing here, but (:nested missing) would be truthy. of course you could interpret the "predicate" as "does the subtree contains any missing values" but that seems like more of a minefield than just having nil values to encourage some sort of tree walking