Skip to content

Instantly share code, notes, and snippets.

@halgari
Created May 15, 2018 15:40
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 halgari/fff9b90c7786942b937ae21fbbcd9f00 to your computer and use it in GitHub Desktop.
Save halgari/fff9b90c7786942b937ae21fbbcd9f00 to your computer and use it in GitHub Desktop.
(defn r-some?
"Super fast version of clojure.core/some that does minimal allocation"
[pred coll]
(reduce
(fn [acc v]
(if-let [val (pred coll)]
(reduced val)
acc))
false
coll))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment