anchor.diff:  (defmacro with-write-pnm-loop ((magic-number max-value) &body body)
     `(let ((height (car (array-dimensions picture)))
   	 (width (cadr (array-dimensions picture))))
  -     (format stream "P~A~%" ,magic-number)	    
  +     (format stream "P~A~%" ,magic-number)
        (format stream "~A ~A~%" width height)
        (when ,max-value
          (format stream "~A~%" ,max-value))
  
positive.code: 	     (let ((byte2 (read-byte stream)))
  	       (case byte2
  		 ((#.(char-code #\1)) (read-pbm-p1 stream))
  		 ((#.(char-code #\4)) (read-pbm-p4 stream)) 
  		 ((#.(char-code #\2)) (read-pgm-p2 stream))
  		 ((#.(char-code #\5)) (read-pgm-p5 stream))
  		 ((#.(char-code #\3)) (read-ppm-p3 stream)) ; ASCII
  
negative.code:      (skip-whitespace-and-comments)
       (read-number height)
       (when ,read-max-value
         (skip-whitespace-and-comments)
         (read-number max-value))
       ,@body))
  
  (defmacro with-pnm-ascii-reader (read-max-value element-type &body body)
    (let ((result (gensym)))
      `(with-pnm-header ,read-max-value
         (loop with size of-type fixnum = (* width height)
  	     with ,result = (make-array `(,height ,width) :element-type ',element-type)
  	     with vec = (make-array `(,size)
  				    :element-type ',element-type
  				    :displaced-to ,result)
  	     for offset of-type fixnum from 0 below size
  	     do ,@body
  	     finally (return ,result)))))
  
  (defun read-pbm-p1 (stream)
    (declare (optimize (speed 3)))
    (with-pnm-ascii-reader nil bit
      (let ((color 0))
        (skip-whitespace-and-comments)
        (read-number color)
        (setf (aref vec offset) color))))
  
  (defun read-pgm-p2 (stream)
    (declare (optimize (speed 3)))
    (with-pnm-ascii-reader nil (unsigned-byte 8)
      (let ((color 0))
        (skip-whitespace-and-comments)
        (read-number color)
        (setf (aref vec offset) color))))
  
  (defun read-ppm-p3 (stream)
    (declare (optimize (speed 3)))
    (with-pnm-ascii-reader nil (unsigned-byte 24)
      (let ((r 0)
  	  (g 0)
  	  (b 0))
  