Skip to content

Instantly share code, notes, and snippets.

@halgari
Forked from AlexBaranosky/gist:4134522
Created November 23, 2012 15:26
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halgari/4136116 to your computer and use it in GitHub Desktop.
Save halgari/4136116 to your computer and use it in GitHub Desktop.
doseq-indexed
;; 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))
@viebel
Copy link

viebel commented May 9, 2016

Here is a live version of this gist http://bit.ly/1VQUSNk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment