Guest User

Untitled

a guest
May 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. (defmacro nth->
  2. "Fast lookup into nested vectors. Indices must be ints"
  3. [coll [id & idx]]
  4. (let [coll (with-meta coll {:tag Indexed})]
  5. (if (seq idx)
  6. `(nth-> (.nth ~coll ~id) ~idx)
  7. `(.nth ~coll ~id))))
Add Comment
Please, Sign In to add comment