anchor.diff:  
   ;               ---- XP STRUCTURES, AND THE INTERNAL ALGORITHM ----
   
  -(eval-when (eval load compile) ;not used at run time.
  -  (defvar block-stack-entry-size 1)
  -  (defvar prefix-stack-entry-size 5)
  -  (defvar queue-entry-size 7)
  -  (defvar buffer-entry-size 1)
  -  (defvar prefix-entry-size 1)
  -  (defvar suffix-entry-size 1))
  -
  -(eval-when (eval load compile) ;used at run time
  -  (defvar block-stack-min-size #.(* 35. block-stack-entry-size))
  -  (defvar prefix-stack-min-size #.(* 30. prefix-stack-entry-size))
  -  (defvar queue-min-size #.(* 75. queue-entry-size))
  -  (defvar buffer-min-size 256.)
  -  (defvar prefix-min-size 256.)
  -  (defvar suffix-min-size 256.))
  -
  -(defstruct (xp-structure (:conc-name nil) (:print-function describe-xp))
  -  (BASE-STREAM nil) ;;The stream io eventually goes to.
  -  LINEL ;;The line length to use for formatting.
  -  LINE-LIMIT ;;If non-NIL the max number of lines to print.
  -  LINE-NO ;;number of next line to be printed.
  -  CHAR-MODE ;;NIL :UP :DOWN :CAP0 :CAP1 :CAPW
  -  CHAR-MODE-COUNTER ;depth of nesting of ~(...~)
  -  DEPTH-IN-BLOCKS
  +(defconstant +block-stack-entry-size+ 1)
  +(defconstant +prefix-stack-entry-size+ 5)
  +(defconstant +queue-entry-size+ 7)
  +(defconstant +buffer-entry-size+ 1)
  +(defconstant +prefix-entry-size+ 1)
  +(defconstant +suffix-entry-size+ 1)
  +
  +(defconstant +block-stack-min-size+ (* 35 +block-stack-entry-size+))
  +(defconstant +prefix-stack-min-size+ (* 30 +prefix-stack-entry-size+))
  +(defconstant +queue-min-size+ (* 75 +queue-entry-size+))
  +(defconstant +buffer-min-size+ 256)
  +(defconstant +prefix-min-size+ 256)
  +(defconstant +suffix-min-size+ 256)
  +
  +(defclass xp-structure ()
  +  ((base-stream :initarg :base-stream :initform nil :accessor base-stream) ;;The stream io eventually goes to.
  +   (linel :initarg :linel :initform nil :accessor linel) ;;The line length to use for formatting.
  +   (line-limit :initarg :line-limit :initform nil :accessor line-limit) ;;If non-NIL the max number of lines to print.
  +   (line-no :initarg :line-no :initform nil :accessor line-no) ;;number of next line to be printed.
  +   (char-mode :initarg :char-mode :initform nil :accessor char-mode) ;;NIL :UP :DOWN :CAP0 :CAP1 :CAPW
  +   (char-mode-counter :initarg :char-mode-counter :initform nil :accessor char-mode-counter) ;depth of nesting of ~(...~)
  +   (depth-in-blocks :initarg :depth-in-blocks :initform nil :accessor depth-in-blocks)
      ;;Number of logical blocks at QRIGHT that are started but not ended.
  -  (BLOCK-STACK (make-array #.block-stack-min-size)) BLOCK-STACK-PTR
  +   (block-stack :initarg :block-stack :initform (make-array +block-stack-min-size+) :accessor block-stack)
  +   (block-stack-ptr :initarg :block-stack-ptr :initform nil :accessor block-stack-ptr)
      ;;This stack is pushed and popped in accordance with the way blocks are
      ;;nested at the moment they are entered into the queue.  It contains the
      ;;following block specific value.
      ;;SECTION-START total position where the section (see AIM-1102)
      ;;that is rightmost in the queue started.
  -  (BUFFER (make-array #.buffer-min-size
  -                      :element-type 'character))
  -   CHARPOS BUFFER-PTR BUFFER-OFFSET
  +   (buffer :initarg :buffer :initform (make-array +buffer-min-size+ :element-type 'character) :accessor buffer)
  +   (charpos :initarg :charpos :initform nil :accessor charpos)
  +   (buffer-ptr :initarg :buffer-ptr :initform nil :accessor buffer-ptr)
  +   (buffer-offset :initarg :buffer-offset :initform nil :accessor buffer-offset)
      ;;This is a vector of characters (eg a string) that builds up the
      ;;line images that will be printed out.  BUFFER-PTR is the
      ;;buffer position where the next character should be inserted in
  
positive.code:       (setq old-prefix (prefix-ptr xp)
  	    old-suffix (suffix-ptr xp)
  	    old-non-blank (non-blank-prefix-ptr xp)))
      (incf (prefix-stack-ptr xp) #.prefix-stack-entry-size)
      (check-size xp prefix-stack (prefix-stack-ptr xp))
      (setf (prefix-ptr xp) old-prefix)
      (setf (suffix-ptr xp) old-suffix)
      (setf (non-blank-prefix-ptr xp) old-non-blank)))
  
  (defun pop-prefix-stack (xp)
    (decf (prefix-stack-ptr xp) #.prefix-stack-entry-size))
  
  (defmacro Qtype   (xp index) `(aref (queue ,xp) ,index))
  (defmacro Qkind   (xp index) `(aref (queue ,xp) (1+ ,index)))
  
negative.code:       (truncate fixnum 10)
      (unless (zerop digits)
        (print-fixnum xp digits))
      (write-char++ (code-char (+ (char-code #\0) d)) xp)))
  
  ;just wants to succeed fast in a lot of common cases.
  ;assumes no funny readtable junk for the characters shown.
  