anchor.diff:    key
     value)
   
  +;; XXX:
  +(defvar *empty-vec* #())
  +
   (defstruct hamt
     (root-entries #()   :type simple-vector)
  +  (new-root-entries *empty-vec* :type simple-vector)
     (root-bitlen 0      :type fixnum-length)
     (test #'equal       :type function)       
     (hash #'hash      :type function)
  
positive.code:             (set-entry node a1 kv1)
              (set-entry node a2 kv2)))))))
  
  (defun resize-root (hamt)
    (declare #.*fastest* (hamt hamt))
    (with-slots (root-entries hash root-bitlen resize-threshold) hamt
      (let* ((new-bitlen (the fixnum-length (+ root-bitlen +PER-ARC-BIT-LENGTH+)))
             (new-root (make-array (ash 2 (1- new-bitlen)) :initial-element nil)))
        (loop FOR e ACROSS root-entries
              FOR base OF-TYPE positive-fixnum FROM 0 
          DO
          (typecase e
            (amt-node (loop FOR arc FROM 0 BELOW +BITMAP-SIZE+
                            FOR sub-e = (get-entry e arc)
                            WHEN sub-e
                        DO
                        (setf (aref new-root (+ (the positive-fixnum (ash arc root-bitlen)) base)) sub-e))
                      (free-entries (amt-node-entries e) *entries-pool*))
  
            (key/value (let ((in (new-arc-stream (k/v-key e) :hash hash)))
                         (declare (dynamic-extent in))
                         (setf (aref new-root (read-n-arc in new-bitlen)) e)))))
        (setf root-entries new-root
              root-bitlen new-bitlen
              resize-threshold (the positive-fixnum (ash resize-threshold +PER-ARC-BIT-LENGTH+))))))
  
  (defun set-impl (key value hamt)
    (declare #.*interface* (hamt hamt))
    (with-slots (root-entries root-bitlen test hash entry-count resize-threshold) hamt
      (declare #.*fastest*)
      (when (< resize-threshold entry-count)
        (resize-root hamt))
      (let ((in (new-arc-stream key :hash hash)))
        (declare (dynamic-extent in))
        (loop WITH node = nil
              FOR arc   = (read-n-arc in root-bitlen) THEN (read-arc in)
              FOR entry = (aref root-entries arc) THEN (get-entry node arc)
          DO
          (typecase entry
            (null (incf entry-count)
                  (return (if node
                              (set-entry node arc (make-key/value key value))
                            (setf (aref root-entries arc) (make-key/value key value)))))
            (amt-node  (setf node entry))
            (key/value 
             (return (if (funcall test key (k/v-key entry))
  
negative.code:                                           (arc-stream-start in) (arc-stream-rehash-count in)
                                            (if node 
                                                (set-entry node arc (make-amt-node))
                                              (setf (aref #1# arc) (make-amt-node)))
                                            hamt)
                         (decf resize-threshold)
                         (resize-one hamt))))))))))
                         
  
  (defsetf get (key hamt) (new-value)
    `(progn (set-impl ,key ,new-value ,hamt)  
  