-
-
Save halgari/4136116 to your computer and use it in GitHub Desktop.
doseq-indexed
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
;; Example: | |
;; (doseq-indexed idx [name names] | |
;; (println (str idx ". " name) | |
(defmacro doseq-indexed-functional [index-sym [item-sym coll] & body] | |
`(doseq [[~item-sym ~index-sym] | |
(map vector ~coll (range))] | |
~@body)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a live version of this gist http://bit.ly/1VQUSNk