Created
December 13, 2013 10:56
-
-
Save d11wtq/7942707 to your computer and use it in GitHub Desktop.
Demonstration implementation of the `->` macro in Clojure.
This file contains hidden or 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 demo-> [val & fns] | |
(reduce (fn [acc fname] (list fname acc)) val fns)) | |
(macroexpand '(demo-> 42 inc dec inc)) ; (inc (dec (inc 42))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment