anchor.diff:    TODO:
     * Use keyword arguments?
     * Implement start, end
  -  * Allow to specify separator insted of newline
  -  "
  -  (when (only-terminal-p trie)
  +  * Allow to specify separator insted of newline"
  +  
  +  (when (leafp trie)
       (let ((width (trie-width trie)))
         ; Print the word and count if not in '(0 1).
         ; Logand changes 1 and 0 to 0 (and changes -1 to -2, but that’s not the point).
         (format t "~A~:[~;~10t~d~]~%" prefix (/= 0 (logand -2 width)) width))
       (return-from print-words))
     (loop as branch in (trie-branches trie) do
  -    (print-words branch
  +    (print-words branch stream
         (concatenate 'string prefix (format nil "~A" (trie-key trie)))))
     (when (equal "" (trie-key trie))
       (trie-width trie)))
   
  -; (defmethod print-object ((object trie) stream)
  -;   (when *print-pretty* (format stream "~&~v@T" 2))
  -;   (format stream "(~S ~d" (trie-key trie) (trie-width trie))
  +; (defmethod print-object ((trie trie) stream)
  +;   ; (when *print-pretty* (format stream "~&~v@T" 2))
  +;   (format stream "(~A ~d" (trie-key trie) (trie-width trie))
   ;   (unless (leafp trie)
   ;     (loop as branch in (trie-branches trie) do
  -;       (print branch)))
  -;   (format stream ")"))
  -
  -(defun pprint-trie (*standard-output* trie &key (compact t))
  -  "Pretty print the trie."
  +;       (write-char #\Space stream)
  +;       (write branch :stream stream)))
  +;   (format stream ")")
  +;   (when (leafp trie) (format stream "~%")))
  +
  +(defun print-trie (trie &optional (stream t) (depth 0) (indent 2))
  +  "## Traverse tries printing out nodes"
  +  (when indent (format stream "~&~v@T" (* depth indent)))
  +  (format stream "(~A ~d" (trie-key trie) (trie-width trie))
  +  (unless (leafp trie)
  +    (loop as branch in (trie-branches trie) do
  +      (print-trie branch stream (+ 1 depth) indent)))
  +  (format stream ")"))
  +
  +(defun pprint-trie (trie &optional (stream t) (compact t))
  +  "Pretty print the trie. Works when structure type is list."
     (pprint-logical-block (*standard-output* trie :prefix "(" :suffix ")")
       (let ((*print-miser-width* nil)   ; Miser mode disables pprint-indent!
             (key (pprint-pop)))
  
positive.code: ;;; Linked cons cells:  3 * cons (8 bits) = 24 bits
  ;;; Class:        16 for class, 20 for vector = 36 bits
  
  (defstruct (trie (:type list))
    "Trie data structure, see package documentation for more info."
    (key "" :read-only t)     ; Generic type -- could be :type char
    (width 0 :type integer)
    (branches nil :type list))  ; Could a vector for optimization, but complicates things!
  
  
negative.code:     ; Extras
      :trie-prob :test-trie
      
      *print-pretty* *print-circle* *boa* *banana*)
    (:use :cl))
  
  (in-package :ptrie)
  
  (setq *print-pretty* t)
  (setq *print-circle* t)
  (setq *print-level* 12)
  
  (defparameter *debug* nil)
  (defparameter *boa* '(blow boa blush foo bar baz))
  (defparameter *banana* '(banana are an bare bane as c bar ar ban b barn))
  
  