anchor.diff:            (setf parts (nconc parts (if (> last-term-pos cur-start-pos)
                                          (list (subseq str cur-start-pos last-term-pos)))))
             (return parts))))
  -          
  +
  +(defun scribble (file obj pos)
  +  (let ((end (file-position file)))
  +    (file-position file pos)
  +    (prin1 obj file)
  +    (file-position file end)))
  +
   (defun write-model-block (nm file)
     (let* ((ode-vars  (numerica-model-ode-vars nm))
            (allvars   (query var))
  -         (klen-pos  nil) ; file position of length of k array
  -         (part-pos  nil) ; file position of length of part array 
            (npart     0))
   
       (labels ((rate-str-without-outer-parens (rate)
  
positive.code:                 (princ #\.)
                  ;; write comment
                  (if (numerica-model-ode-comments-p nm)
                      (b-format file "~%~4T# ~A = ~A " v rate)))
            do
                  ;; write functions
                  (write-functions i rate))
  
      ;; now, we've determine the actual # kvars ...
      ;; go back and scribble at klen-pos
      (scribble (numerica-model-kvar-count nm) klen-pos)
      (scribble npart part-pos)
      (format file "~%END~%~%"))))
  
  
  
negative.code: ;;;;     (with-dimensionless-math (numerica-model-base-units ci)
  ;;;;       (let ((low-t0     (lowest-non-zero (numerica-model-ode-vars ci) ?.t0))
  ;;;;             (low-kvar   (lowest-non-zero (numerica-model-kvars ci) ?.value)))
  ;;;;         {low-t0 low-kvar}))))
  
  
  ;;;; (defun refresh-parameters (&optional (model *numerica-model*))
  ;;;;   "Rewrites the parameters/initial conditions of a model (default is *numerica-model*) to the model's initfile."  
  ;;;;   (let* ((name (numerica-model-init-script-name model))
  ;;;;          (path (numerica-model-path model))
  ;;;;          (init-path (numerica-file-path name path)))
  ;;;;     (with-open-file (file init-path :direction :output)
  ;;;;       (write-init-script file model))
  ;;;;     (format t "New parameters file (~A.~A) written to ~A."
  ;;;;             (pathname-name init-path)
  ;;;;             (pathname-type init-path)
  ;;;;             path)))