In Clojure, `nil` represents the absence of a value or a null reference. A missing map value or an unfilled form field can therefore reach a function that cannot handle it. Choose a response based on the job: substitute a default, stop a processing pipeline, or use an operation that accepts `nil`. section 2.2.1 section 2.3.4 section 13.2
Three useful behaviors differ:
- `fnil` wraps a function and replaces `nil` arguments at specified positions before calling it. It accepts defaults for at most the first three positions. section 2.2.1
- `some->` and `some->>` stop a threaded computation and return `nil` when a step produces `nil`. They place the preceding result as the next form’s second or last argument, respectively. section 2.3.4
- `set` accepts a `nil` input collection and returns an empty set. section 13.2
Default or stop?
`(update {:a 1 :b 2} :c inc)` throws a `NullPointerException`; `(update {:a 1 :b 2} :c (fnil inc 0))` returns `{:a 1 :b 2 :c 1}`. If the missing `:c` should instead halt the calculation, `(some-> {:a 1 :b 2} :c inc)` returns `nil`. section 2.2.1 section 2.3.4


































