doto

macrosince v0.0-927 clojure.core/dotoEdit
(doto x & forms)

Source docstring:
Evaluates x then calls all of the methods and functions with the
value of x supplied at the front of the given arguments.  The forms
are evaluated in order.  Returns x.

(doto (new js/Map) (.set "a" 1) (.set "b" 2))
Source code @ clojurescript:src/main/clojure/cljs/core.cljc
(core/defmacro doto
  [x & forms]
  (core/let [gx (gensym)]
    `(let [~gx ~x]
       ~@(map (core/fn [f]
                (if (seq? f)
                  `(~(first f) ~gx ~@(next f))
                  `(~f ~gx)))
           forms)
       ~gx)))