anchor.diff:                              :adjustable t)))
       (flet ((initialize-vector-table ()
                (setf vector-hash (make-hash-table :test 'equal)
  -                   next-entry +first-entry+))
  +                   next-entry +first-entry+
  +                   code-size +initial-code-size+))
              (get-next-code ()
  -             (get-bits compressed-vector
  -                       input-bit-offset
  -                       (incf input-bit-offset code-size)))
  +             (let ((code (get-bits compressed-vector
  +                                   input-bit-offset
  +                                   (incf input-bit-offset code-size))))
  +               
  +               code))
              (vector-from-code (code)
                (if (< code +clear-code+)
                    (vector code)
                    (gethash code vector-hash)))
              (add-vector-to-table (vector)
                (setf (gethash next-entry vector-hash) vector)
  -             (incf next-entry))
  +             (incf next-entry)
  +             (when (= next-entry (- (expt 2 code-size) 1))
  +               (incf code-size)))
              (write-code (int)
                (ensure-array-size-and-set-fill-pointer
                 output output-byte-offset)
  
positive.code: 
  (defun lzw-encode (raw-vector)
    (declare (optimize (debug 2)))
    (let ((vector-hash)
          (next-entry)
          (bit-count 0)
          (output (make-array 256
                              :element-type '(unsigned-byte 8)
                              :fill-pointer 0
                              :adjustable t)))
      (labels ((initialize-vector-table ()
                 (setf vector-hash (make-hash-table :test 'equalp)
                       next-entry +first-entry+))
               (lookup-vector (vector)
                 (cond ((= (length vector) 1)
                        (char-code (elt vector 0)))
                       ((> (length vector) 1)
                        (gethash vector vector-hash))
                       (t (error "huh?"))))
               (add-vector (vector)
                 (setf (gethash vector vector-hash) next-entry)
                 (incf next-entry))
               (code-size ()
                 (integer-length next-entry))
               (write-code (int)
                 (let ((new-fill-pointer
                        (1+ (ash (+ bit-count (code-size)) -3))))
                   (ensure-array-size-and-set-fill-pointer
                    output new-fill-pointer)
                   (set-bits output bit-count (+ bit-count (code-size))
                             int))
                 (incf bit-count (code-size))
                 (when (= int +clear-code+)
                   (progn
                     ;; FIXME
                     ;; do something special here
                     ))))
        (initialize-vector-table)
        (write-code +clear-code+)
        (let ((omega))
          (loop for k across raw-vector
             do
               (let ((cat (concatenate 'vector omega (vector k))))
                 (if (lookup-vector cat)
                     (setf omega cat)
                     (progn
                       (write-code (lookup-vector omega))
                       (add-vector cat)
                       (setf omega (vector k))
                       (when (= next-entry 4093)
                         (write-code +clear-code+))))))
          (write-code (lookup-vector omega)))
        (write-code +end-of-information-code+)
        output)))
  
  (defconstant +initial-code-size+ 9)
  
  
negative.code: ;;     } /* end of not-ClearCode case */ 
  ;;  } /* end of while loop */ 
  
  (defun lzw-decode-codes (compressed-vector)
    (declare (optimize (debug 2)))
    (let ((bit-offset 0)
          (code-size +initial-code-size+)
          (next-entry +first-entry+))
      (labels ((get-next-code ()
                 (let ((code (get-bits compressed-vector
                                       bit-offset
                                       (incf bit-offset code-size))))
                   (cond ((= next-entry (- (expt 2 code-size) 2))
                          (incf code-size)
                          code)
                         ((= code +clear-code+)
                          (setf code-size +initial-code-size+)
                          (get-next-code))
                         (t code)))))
        (loop for code = (get-next-code)
           with old-code
           while (not (= code +end-of-information-code+))
           when old-code do (incf next-entry)
           do (setf old-code code)
           collect code))))
  
  (defun lzw-decode (compressed-vector &key stream)
  