anchor.diff:  ;;; Puzzle solver
   ;;; Returns a list, each element of which is a sequence of moves that lead to a solution.
   (defun solve-puzzle (m c)
  -  (let ((solutions))
  -    (do ((s-s (list (new-state :missionaries m :cannibals c :has-boat t)) (solve-next-move m c s-s)))
  -        ((or (not s-s)) nil)
  -      (when (winning-state-p (first s-s))
  -        (push (nreverse (copy-tree s-s)) solutions)))
  -    (nreverse solutions)))
  +  (let ((*m* m)
  +        (*c* c))
  +    (let ((solutions))
  +      (loop for s-s = (list (new-state :missionaries m :cannibals c :has-boat t))
  +         then (solve-next-move s-s)
  +         until (null s-s)
  +         when (winning-state-p (car s-s)) do (push (nreverse (copy-tree s-s)) solutions))
  +      (nreverse solutions))))
  
positive.code:         (let ((missionaries (+ (getf current-state :missionaries) (getf move :missionaries)))
                (cannibals (+ (getf current-state :cannibals) (getf move :cannibals)))
                (has-boat (not (getf current-state :has-boat))))
            (let ((next-state (new-state :missionaries missionaries :cannibals cannibals :has-boat has-boat :branch-idx 0)))
              (and (valid-state-p m c next-state) (not (visited-state-p next-state state-stack)) next-state))))))
  
  ;;; Finds a valid next state for given current state
  ;;; and starting branch position.
  
negative.code:   (states-equal-p *winning-state* a-state))
  
  (defmacro new-state (&rest rest)
    `(list ,@rest :branch-idx 0))
  
  (declaim (inline visited-state-p))
  (declaim (inline valid-state-p))
  