Created
May 14, 2015 18:57
-
-
Save leblowl/01d6f4d8e5d4261959ee to your computer and use it in GitHub Desktop.
Util fun
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
(defn slurp-edn [f] | |
(with-open [r (PushbackReader. (io/reader f))] | |
(let [edn-seq (repeatedly (partial edn/read {:eof :EOF} r))] | |
(doall (take-while #(not= :EOF %) edn-seq))))) | |
(defn in? | |
"true if seq contains elm" | |
[seq elm] | |
(some #(= elm %) seq)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment