Created
August 25, 2010 16:40
-
-
Save jclaggett/549822 to your computer and use it in GitHub Desktop.
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
; Experiment with 'foo' blocks as an alternative to -> and ->>. | |
(defmacro foo | |
([] '%) | |
([form & more] | |
`(let [~'% ~form] (foo ~@more))) ) | |
(def foo-ex1 | |
(foo | |
1 | |
(+ 1 %) | |
(/ % 2) ) ) | |
(def foo-ex2 | |
[ | |
'(->> | |
(map vector (range) coll) | |
(filter (fn [[i & args]] (apply f args))) | |
(map first)) | |
'(foo | |
(map vector (range) coll) | |
(filter (fn [[i & args]] (apply f args)) %) | |
(map first %)) ] ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment