Skip to content

Instantly share code, notes, and snippets.

@timmc
Forked from anonymous/gist:5049270
Last active December 14, 2015 07:18
(defmacro builder [initial method & argsets]
(list* 'doto initial
(for [args argsets]
`(~method ~@args))))
;; Example:
(builder (StringBuilder.) .append [1] ["a"])
;; becomes...
(doto (StringBuilder.)
(.append 1)
(.append "a"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment