Skip to content

Instantly share code, notes, and snippets.

@jclaggett
Created September 28, 2010 16:05
Show Gist options
  • Save jclaggett/601272 to your computer and use it in GitHub Desktop.
Save jclaggett/601272 to your computer and use it in GitHub Desktop.
(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