       map
       (let [arg  (first args)
             args (rest args)]
-       (cond
-         (nil?  arg) (recur args map)
-         (map?  arg) (recur args (merge map arg))
-         (coll? arg) (recur (into args (reverse arg)) map)
-         :else       (recur (rest args) (assoc map arg (first args))))))))
+       (condp #(%1 %2) arg
+         nil?  (recur args map)
+         map?  (recur args (merge map arg))
+         coll? (recur (into args (reverse arg)) map)
+         (recur (rest args) (assoc map arg (first args))))))))
 
 (defn position
-  "Returns a map from item to the position of its first occurance in coll."
+  "Returns a map from item to the position of its first occurence in coll."
   [coll]
   (into {} (reverse (map-indexed #(vector %2 %1) coll))))
 

    (mapcat #(deref %)
            (map #(future (map f %)) (slice n coll)))))

(defn assoc-in!
  "Associates a value in a nested associative structure, where ks is a sequence of keys
  and v is the new value and returns a new nested structure. The associative structure
  can have transients in it, but if any levels do not exist, non-transient hash-maps will
  be created."
  [m [k & ks] v]
  (let [assoc (if (instance? clojure.lang.ITransientCollection m) assoc! assoc)]
    (if ks
      (assoc m k (assoc-in! (get m k) ks v))
      (assoc m k v))))

(defn update-in!
  "'Updates' a value in a nested associative structure, where ks is a sequence of keys and
  f is a function that will take the old value and any supplied args and return the new
  value, and returns a new nested structure. The associative structure can have transients
  in it, but if any levels do not exist, non-transient hash-maps will be created."
  [m [k & ks] f & args]
  (let [assoc (if (instance? clojure.lang.ITransientCollection m) assoc! assoc)]
    (if ks
      (assoc m k (apply update-in! (get m k) ks f args))
      (assoc m k (apply f (get m k) args)))))

(defn thrush
  "Takes the first argument and applies the remaining arguments to it as functions from left to right.

  [f]
  (.addShutdownHook
   (Runtime/getRuntime)
   (Thread. f)))

(defn- parse-opt [default opts arg]
  (let [m re-matches, key (comp keyword str)]
