anchor.diff:   between 2 points"
     (ematch *tree*
       ((rectangle root)
  -     (%nns root point (list nil MOST-POSITIVE-DOUBLE-FLOAT)
  +     (%nns root point
  +           (nearest-element nil MOST-POSITIVE-DOUBLE-FLOAT)
  +           MOST-POSITIVE-DOUBLE-FLOAT
              distance-function))))
   
  -(export '(nearest-neighbor-search
  -          mindist
  -          minimax-dist
  -          abl-element
  -          abl-mindist
  -          abl-node
  -          abl-minimax-dist))
   
  -(defstruct (abl-element (:conc-name abl-))
  -  (node nil :type spatial-tree-node)
  -  (mindist 0 :type number)
  -  (minimax-dist 0 :type number))
  -
  -(defun %nns (node point nearest fn)
  +(defun %nns (node point nearest upper-bound fn)
     (match node
       ((spatial-tree-leaf-node children)
        (reduce (lambda (best current)
                  (match best
  -                 ((list _ mindist)
  -                  (let ((dist (funcall fn point current)))
  -                    (if (< dist mindist)
  -                        (list current dist)
  +                 ((nearest-element (object _) dist)
  +                  (let ((newdist (funcall fn point current)))
  +                    (if (< newdist dist)
  +                        (nearest-element current newdist)
                           best)))))
                children
                :initial-value nearest))
  
positive.code: it as an estimate of the NN distance) because M
  contains an object O’ which is nearer to P (theorem
  2). This is also used in downward pruning."
    )
    
  (defun prune-upward (node point nearest abl)
    "every MBR M with MINDIST(P,M) greater than
  the actual distance from P to a given object O is
  discarded because it cannot enclose an object nearer
  than O (theorem 1). We use this in upward pruning."
    )
negative.code: 
       ;; We then apply pruning strategies 1 and 2 to the ABL to
       ;; remove unnecessary branches.
       (iter (with last = (prune-downward-1
                           node point nearest
                           (sort (mapcar (lambda (child)
                                           (let ((mbr (mbr child *tree*)))
                                             (abl-element child
                                                          (mindist point mbr)
                                                          (minimax-dist point mbr))))
                                         children) #'<
                                 :key #'abl-mindist)))
  
  