Created
July 27, 2010 17:36
-
-
Save arohner/492566 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 nth-> | |
"Fast lookup into nested vectors. Indices must be ints" | |
[coll [id & idx]] | |
(let [coll (with-meta coll {:tag Indexed})] | |
(if (seq idx) | |
`(nth-> (.nth ~coll ~id) ~idx) | |
`(.nth ~coll ~id)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment