anchor.diff:  ;;; Insertion
   
   (defun add-seqs (trie seqs)
  -    (mapcar #'(lambda (seq) (add-seq trie seq))
  -        seqs))
  +    (mapcar #'(lambda (seq) (add-seq trie seq)) seqs))
   
   (defun add-seq (trie seq &optional (count 1))
       "Add a branch to the trie count times. If branch already exists, increase it’s width.
       A count below one is changed to one. Modifies trie in-place."
  -    (when (< count 0) (error (format nil "Negative count ~A." count)))
  +    (when (< count 0)
  +        (error (format nil "Negative count ~A." count)))
       (incf (trie-width trie) count)
       (when (zerop (length seq))
           (add-key trie t count)
           (return-from add-seq trie))
       (let ((symbol (add-key trie (elt seq 0) 0)))
  -        ; (add-key trie (elt seq 0) count)
           (add-seq symbol (subseq seq 1) count)))
   
   (defun add-key (trie key &optional (count 1))
       "Add a node to trie. If node exists, increases it’s width."
  -    (when (< count 0) (error (format nil "Negative count ~A." count)))
  +    (when (< count 0)
  +        (error (format nil "Negative count ~A." count)))
       (let ((node (find-key trie key)))
           (if node
               (incf (trie-width node) count)
  
positive.code: ;                       (delete #\b (trie-branches r)
  ;                       :test #'equal
  ;                       :key (lambda (n) (trie-key n))))
  ;             (remove-key trie (elt seq 0))
  ;             (return-from remove-seq nil))
  ;         (remove-seq symbol (subseq seq 1) count)))
  
  
  ;;; Probabilities
  
  (defun trie-prob (root suffix)
      "Returns probability of suffix on given trie."
      (let ((root-width (trie-width root))
            (node-width (or (trie-width (find-seq root suffix)) 0)))
          (/ node-width root-width)))
  
  
  ;;; Sorting
  
  ; TODO
  
  
  ;;; Traversal & printing
  
  (defun print-words (trie &optional (prefix "") start end &key (with-count))
      "## Prints words from the trie. Prints word counts after tab when over one.
  
negative.code: ;     (format stream ")"))
  
  (defun pprint-trie (*standard-output* trie &key (raw nil))
      "Pretty print the trie."
      (let ((*print-miser-width* nil))  ; Miser mode disables pprint-indent!
          (pprint-logical-block (*standard-output* trie :prefix "(" :suffix ")")
              ; Print key
              (if (characterp (first trie))
                  (write-char (pprint-pop))
                  (write (pprint-pop)))
              (write-char #\Space)
              ; Print width
              (pprint-indent :current 0)
              (write (pprint-pop))
              ; Branches
              (cond
                  ((branchesp trie)
                      ; Print list of Branches
                      (write-char #\Space)
                      (when *debug* (write :+))
                      (loop as branch in (trie-branches trie) do
                          (when *debug* (write :~))
                          ; Word endings
                          (unless raw
                              (when (wordp trie)          ; FIXME Prints extra bullets
                                  (write-char #\u2022))   ; Bullet
                              (when (leafp branch) (return-from pprint-trie)))
                          ; THIS makes the newline after leaf!
                          (pprint-newline :mandatory)
                          (pprint-indent :current 0)
                          ; Next level
                          (pprint-trie *standard-output* branch :raw raw)
                          ; Exit after leaf
                          (pprint-exit-if-list-exhausted)
                          (when *debug* (write :*)))
                      (when *debug* (write :@)))
                  (t ; Is leaf
                      (when *debug* (write :%))
                      (pprint-exit-if-list-exhausted))))))
  
  (defun print-trie (trie &optional (depth 0) (indent 2))
      "Traverse tries printing out nodes"
      (when indent (format t "~&~v@T" (* depth indent)))
      (format t "(~S ~d" (trie-key trie) (trie-width trie))
      (when (branchesp trie)
          (loop as branch in (trie-branches trie) do
              (print-trie branch (+ 1 depth) indent)))
      (format t ")"))
  
  
  
  