Skip to content

Instantly share code, notes, and snippets.

@d11wtq
Created December 13, 2013 10:56
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 d11wtq/7942707 to your computer and use it in GitHub Desktop.
Save d11wtq/7942707 to your computer and use it in GitHub Desktop.
Demonstration implementation of the `->` macro in Clojure.
(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