   (-> (Runtime/getRuntime)
       (.addShutdownHook (Thread. shutdown-func))))
 
-(defn find-first-next [pred aseq]
-  (loop [[curr & restseq] aseq]
-    (if (pred curr)
-      [curr restseq]
-      (recur restseq))))
-
 (defn repeat-seq
   [amt aseq]
   (apply concat (repeat amt aseq)))
 
+;; TODO: Remove.
 (defn flattened-count [xs]
   (reduce + (map count xs)))
 
 (defmacro dofor [bindings & body]
   `(doall (for ~bindings (do ~@body))))
-
-(defmacro dofor [bindings & body]
-  `(doall (for ~bindings (do ~@body))))
-
-(defmacro as-futures [[a args] & body]
-  (let [parts          (partition-by #{'=>} body)
-        [acts _ [res]] (partition-by #{:as} (first parts))
-        [_ _ task]     parts]
-    `(let [~res (for [~a ~args] (future ~@acts))]
-       ~@task)))
 
 (defmacro p-dofor [bindings & body]
   `(let [futures# (dofor ~bindings

  (= s2 (first (sort [s1 s2]))))

(defmacro safe-assert
  ([x] `(safe-assert ~x ""))
  ([x msg]
     (if (>=s (clojure-version) "1.3.0")
       `(assert ~x ~msg)
       `(assert ~x))))

(defn sleep [len]
  (when (pos? len)
    (Thread/sleep len)))


(defn prioritize [pred coll]
  (apply concat (separate pred coll)))

;; TODO: Remove
(defn remove-val [v aseq]
  (filter (partial not= v)
          aseq))

(defn mk-rw-lock []
  (ReentrantReadWriteLock.))
