Skip to content

Instantly share code, notes, and snippets.

@odyssomay
Created May 14, 2011 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odyssomay/972423 to your computer and use it in GitHub Desktop.
Save odyssomay/972423 to your computer and use it in GitHub Desktop.
Subvector at value
(defn subvec-at-val [val v]
(let [limit (count v)]
(loop [i 0]
(if (== i limit)
[]
(if (= x (v i))
(subvec v i)
(recur (inc i)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment