anchor.diff:      (if (and (> index 0)
                (funcall compare-fn item (aref elements (heap-parent index))))
           (heap-improve-key elements hash index compare-fn)
  -        (heapify elements hash index compare-fn))))
  +        (heapify elements hash index compare-fn)))
  +  q)
   
   (defun queue-delete (q item)
  +  "Delete item from the queue. Returns the queue."
     (let* ((hash (q-item-index q))
            (index (gethash item hash)))
       (assert index nil "index for item ~A not found in hash" item)
  -    (heap-delete (q-elements q) hash index (q-compare-fn q))))
  +    (heap-delete (q-elements q) hash index (q-compare-fn q)))
  +  q)
   
   ;;;; The Heap Implementation of Priority Queues
   
  
positive.code: (in-package #:priority-queue)
  
  ;; For queue-replace to work, the items stored in the queue must be
  ;; unique when tested by 'eql.
  
  (defstruct q
    (compare-fn nil :type function)
  
negative.code:   (heap-extract-min (q-elements q) (q-item-index q) (q-compare-fn q)))
  
  (defun queue-insert (q item)
    "Insert the item by priority according to the compare
  function. Returns the queue."
    (heap-insert (q-elements q) (q-item-index q) item (q-compare-fn q))
    q)
  
  (defun queue-replace (q old new)
    "Replace old with new in the queue. This is analogous to deleting
  the old item and inserting the new one, but it is almost always more
  efficient (and never less efficient) because we can just fix up the
  heap from the position of the swapped item. Returns the queue."
    (let* ((hash (q-item-index q))
           (compare-fn (q-compare-fn q))
           (elements (q-elements q))
  