store/[org.clojure/clojure "1.8.0"] clj::clojure.core/when-some

Official Documentation

Add notes
Arities
==================================================
   [bindings & body]

Docstring
==================================================
  bindings => binding-form test

   When test is not nil, evaluates body with binding-form bound to the
   value of test

Source

(defmacro when-some
  "bindings => binding-form test

   When test is not nil, evaluates body with binding-form bound to the
   value of test"
  {:added "1.6"}
  [bindings & body]
  (assert-args
     (vector? bindings) "a vector for its binding"
     (= 2 (count bindings)) "exactly 2 forms in binding vector")
   (let [form (bindings 0) tst (bindings 1)]
    `(let [temp# ~tst]
       (if (nil? temp#)
         nil
         (let [~form temp#]
           ~@body)))))

Uses on crossclj