Skip to content

Instantly share code, notes, and snippets.

@jebberjeb
Last active December 26, 2015 03:59
Show Gist options
  • Save jebberjeb/7089813 to your computer and use it in GitHub Desktop.
Save jebberjeb/7089813 to your computer and use it in GitHub Desktop.
(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