Created
September 28, 2010 16:05
-
-
Save jclaggett/601272 to your computer and use it in GitHub Desktop.
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 topic | |
([t] nil) | |
([t form] form) | |
([t form & more] | |
`(let [~t ~form] (topic ~t ~@more))) ) | |
(def topic-ex1 | |
(topic % 1 | |
(+ 1 %) | |
(/ % 2) ) ) | |
(def topic-ex2 | |
[ | |
'(->> | |
(map vector (range) coll) | |
(filter (fn [[f & args]] (apply f args))) | |
(map first) ) | |
'(topic coll | |
(map vector (range) coll) | |
(filter (fn [[f & args]] (apply f args)) coll) | |
(map first coll) ) ] ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment