Skip to content

Instantly share code, notes, and snippets.

@luxbock
Created February 6, 2015 10:10
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 luxbock/97588fd2a4d03f1ef8f7 to your computer and use it in GitHub Desktop.
Save luxbock/97588fd2a4d03f1ef8f7 to your computer and use it in GitHub Desktop.
boo
(defmacro boo->> [& body]
(let [syms (repeatedly (count body) gensym)
exprs (map (fn [f sym]
(if (seq? f)
`(~(first f) ~@(next f) ~sym)
`(~f ~sym)))
(rest body) (rest syms))]
`(let [~(first syms) ~(first body)
~@(interleave (rest syms) exprs)]
~(vec syms))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment