anchor.diff:  ;;;;AUTHORS
   ;;;;    <PJB> Pascal J. Bourguignon <pjb@informatimago.com>
   ;;;;MODIFICATIONS
  +;;;;    2020-03-01 <PJB> Optimized CONTENTS-FROM-STREAM (avoid adjust-array when reading a whole file).
   ;;;;    2007-07-07 <PJB> Added CONTENTS-FROM-STREAM.
   ;;;;    2005-03-17 <PJB> Added COPY-OVER.
   ;;;;    2004-09-12 <PJB> Removed use of GRAY streams,
  
positive.code:                                    :adjustable t :fill-pointer t))
                 (start 0))
            (loop
              (let ((end (read-sequence buffer stream :start start)))
                (when (or (< end busize) (and length (= length end)))
                  ;; we got eof, or have read enough
                  (setf (fill-pointer buffer) end)
                  (return-from contents-from-stream buffer))
                ;; no eof; extend the buffer
                (setf busize
                      (if (or (null max-extend) (<= (* 2 busize) max-extend))
                          (* 2 busize)
                          (+ busize max-extend))
                      start end))
              (adjust-array buffer busize :initial-element initel :fill-pointer t))))))
  
  
  
  (defun copy-over (stream from-pos to-pos &key (element-type 'character))
  
negative.code:                 :do (vector-push-extend byte buffer))
                (return-from contents-from-stream buffer)))
          ;; normal case:
          (let* ((busize (or length (setf length (ignore-errors (file-length stream))) min-size))
                 (eltype (stream-element-type stream))
                 (initel (if (subtypep eltype 'integer) 0 #\space))
                 (buffer (make-array busize
  