       (== 1 cnt) []
       :else  (subvec coll 0 (dec cnt))))
 
-
   ICollection
   (-conj [coll o]
     (PersistentVector. (hamt/set (+ offset cnt) o h) offset (inc cnt)))

    (hamt/hash o)))

(defn get
  ([o k]
   (get o k nil))
  ([o k not-found]
   (cond
     (satisfies? ILookup o)
     ; TODO multiple arity protocols, damn
     (let [res (-lookup o k)]
       (if res res not-found))
     
     (or (array? o) (string? o))
     (if (< k (.-length o))
       (aget o k))
     
     :else not-found)))


  bounds, nth throws an exception unless not-found is supplied.  nth
  also works for strings, arrays, regex Matchers and Lists, and,
  in O(n) time, for sequences."
  ([coll n]
   (cond
     (not (number? n))
     (throw (js/Error. "index argument to nth must be a number"))

     (nil? coll)
     coll

     (or (array? coll) (string? coll))
     (when (< n (.-length coll))
       (aget coll n))

     (satisfies? IIndexed coll)
     (-nth coll n)

     (satisfies? ISeq coll)
     (linear-traversal-nth coll n)

     :else
     (throw (js/Error. (str "nth not supported on this type: "
                            (pr-str coll))))))
  ([coll n not-found]
   (cond
     (not (number? n))
     (throw (js/Error. "index argument to nth must be a number"))
     
     (nil? coll)
     not-found

     (or (array? coll) (string? coll))
     (if (< n (.-length coll))
       (aget coll n)
       not-found)
     
     (satisfies? IIndexed coll)
     (-nth coll n not-found)
     
     :else
     (throw (js/Error. (str "nth not supported on this type "
                            (pr-str coll)))))))
     

(defn first
  "Returns the first item in the collection. Calls seq on its
