Skip to content

Instantly share code, notes, and snippets.

@timmc
Forked from anonymous/gist:5049270
Last active December 14, 2015 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timmc/5049288 to your computer and use it in GitHub Desktop.
Save timmc/5049288 to your computer and use it in GitHub Desktop.
(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