Last active
December 26, 2015 03:59
-
-
Save jebberjeb/7089813 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
(ns test-app.core) | |
(def r (range 10)) | |
(def s (set r)) | |
(def v (apply vector r)) | |
;; We can do this because set is seqable, so | |
;; drop-while can seq it. | |
(drop-while (partial > 5) s) | |
;; How do we know something is seqable? No... | |
[(seq? s) (coll? s) (sequential? s)] | |
(defn seqable? | |
[x] | |
(instance? clojure.lang.Seqable x)) | |
;; Yes... | |
(seqable? s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment