Skip to content

Instantly share code, notes, and snippets.

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