when-some lexically binds one value and evaluates multiple body forms only when that value is not nil. It returns nil otherwise. section 3.1.2
Its contract is:
- Accept one binding pair, whose expression may produce a destructured value. section 3.1.2
- Bind the result in lexical scope and treat the body as an implicit do block. section 3.1.2
- Run the body for any non-nil value, including false; return nil for nil. section 3.1.2
Non-nil, not merely truthy
(when-some [n "then"] n) ;; "then" (when-some [n nil] n) ;; nil (if-some [n false] n "else") ;; false
