some->

added
1.5

ns
clojure.core

type
macro

(some-> expr & forms)

When expr is not nil, threads it into the first form (via ->),
and when that result is not nil, through the next etc

                user=> (-> {:a 1} :b inc)
;; NullPointerException   clojure.lang.Numbers.ops (Numbers.java:942)

user=> (some-> {:a 1} :b inc)
;; nil

            
                ;; Often used to "short-circuit out" of a series of steps:

(some-> val
        step1
        step2
        step3)

;; When nil is returned by any step, the further steps are not executed. Thus
;; the nil case need be handled only once, at the end.