 
 (defn vector [& args] (vec args))
 
-(defn- hash-map-seq [hash-map i]
-  (lazy-seq
-    (when (< i (.length (.keys hash-map)))
-      (cons
-        (vector (aget (.keys hash-map) i)
-                (-lookup hash-map (aget (.keys hash-map) i)))
-        (hash-map-seq hash-map (inc i))))))
+(extend-protocol IHash
+  goog.global.Number (-hash [o] o))
+
+(defn hash [o] (-hash o))
+
+(defn- scan-array [incr k array]
+  (let [len (.length array)]
+    (loop [i 0]
+      (when (< i len)
+        (if (= k (aget array i))
+          i
+          (recur (+ i incr)))))))
 
 ; Keys is an array of all keys of this map, in no particular order.
 ; Any string key is stored along with its value in strobj. If a string key is

          (let [new-keys (array-clone keys)] ; append
            (.push new-keys k)
            (HashMap. meta new-keys new-strobj hashobj))))
      "tbd-non-string-key"))
  
  IMap
  (-without [coll k]
    (if (goog.isString k)
      (if (not (.hasOwnProperty strobj k))
        coll ; key not found, return coll unchanged
        (let [new-keys (array-clone keys)
              new-strobj (goog.cloneObject strobj)
              new-count (dec (.length keys))]
          (loop [i 0] ; look for k in keys
            (if (not (= k (aget new-keys i)))
              (recur (inc i))
              (loop [i i] ; shift subsequent keys down one step
                (when (< i new-count)
                  (aset new-keys i (aget new-keys (inc i)))
                  (recur (inc i))))))
          (set! new-keys.length new-count) ; fix up keys length
          (js-delete new-strobj k)         ; fix up strobj
          (HashMap. meta new-keys new-strobj hashobj)))
      "tbd-non-string-key")))

(set! cljs.core.HashMap.EMPTY (HashMap. nil (array) (js-obj) (js-obj)))


  ISeqable
  (-seq [coll]
    (when (> (.length keys) 0)
      (let [hash-map-seq
             (fn hash-map-seq [i]
               (lazy-seq
                 (when (< i (.length keys))
                   (cons
                     (vector (aget keys i) (-lookup coll (aget keys i)))
                     (hash-map-seq (inc i))))))]
        (hash-map-seq 0))))

  ICounted
  (-count [coll] (.length keys))

  ILookup
  (-lookup [coll k] (-lookup coll k nil))
  (-lookup [coll k not-found]
    (if (goog.isString k)
      (if (.hasOwnProperty strobj k)
        (aget strobj k)
        not-found)
      ; non-string key
      (let [h (hash k)
            bucket (aget hashobj h)
            i (when bucket (scan-array 2 k bucket))]
        (if i
          (aget bucket (inc i))
          not-found))))

  IAssociative
  (-assoc [coll k v]
