anchor.diff:    ((tokens :initarg :tokens :accessor tokens)
      (iterations :initform nil :accessor iterations)
      (prologue :initform nil :accessor prologue)
  -   (destructurings :initform nil :accessor destructurings)
      (initially :initform nil :accessor initially)
      (finally :initform nil :accessor finally)
      (during-first :initform nil :accessor during-first)
  
positive.code: (defun nreverse-loop-state (state)
    (macrolet ((rev% (&rest accs)
                 (cons 'progn (loop :for a :in accs :collect `(setf (,a state) (nreverse (,a state)))))))
      (rev% iterations prologue initially finally during-first during-last)
      (let ((body (nreverse (body state))))
        (loop :for (list var) :in (destructurings state) :do
          (setf body `((destructuring-bind ,list ,var ,@body))))
        (setf (body state) body)))
    state)
  
  (defun push-tokens (state toks)
  
negative.code:     (let ((test (when test-op
                    (with-local-var (v end state)
                      (list test-op var v)))))
        (push `(,var nil ,start (,op ,var ,(or by 1)) ,test) (iterations state)))))
  
  (defun for-= (var bindings state)
    (let ((start (eat state))
          (then (eat state :if :then)))
      (push (list var bindings start (or then start) nil) (iterations state))))
  
  (defun for-in (var bindings state)
    (with-local-var (arr (eat state) state)
      (let ((index (or (eat state :if :index) (ps-gensym))))
        (push-tokens state `(,index :from 0 :below (length ,arr)
                                    ,var := (aref ,arr ,index)))
        (for-clause state)
        (for-clause state)
        ;; set bindings associated with original clause, e.g. "loop :for (a b) :in c"
        (setf (second (car (iterations state))) bindings))))
  
  (defun for-on (var bindings state)
    (with-local-var (arr (eat state) state)
      (let ((by (aif (eat state :if :by)
                     `(,(reduce-function-symbol it) ,var)
                     `((@ ,var :slice) 1))))
        (push-tokens state `(,var := ,arr :then ,by))
        (for-clause state)
        (let ((this-iteration (car (iterations state))))
          (setf (second this-iteration) bindings)
          ;; set the end-test
          (setf (fifth this-iteration) `(or (null ,var) (= (length ,var) 0)))))))
  
  (defun for-clause (state)
    (let* ((place (eat state))
           (var (when (atom place) place))
           (bindings (unless var place))
           (term (eat state :atom)))
      (when bindings
        (when (eq term :from)
          (err "an atom after FROM" bindings))
        (setf var (ps-gensym)))
      (case term
        (:from (for-from var state))
        (:= (for-= var bindings state))
        ((:in :across) (for-in var bindings state))
        (:on (for-on var bindings state))
        (otherwise (error "FOR ~s ~s is not valid in PS-LOOP." var term)))))
  
  (defun accumulate (kind term var state)
  