Skip to content

clojure.core/doto

View this page on ClojureDocs

Type: macro Added: Clojure 1.0 Examples: 4 Runnable: 0
([x & forms])

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 java.util.HashMap) (.put "a" 1) (.put "b" 2))

Examples

by dakrone on . May have evaluation errors.
by shockbob on . May have evaluation errors.
by jimpil on . May have evaluation errors.
by benjamin-asdf on . May have evaluation errors.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.