-
-
Save luxbock/3e2e54598946a2d3d2b3 to your computer and use it in GitHub Desktop.
boo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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