anchor.diff:               (let ((thread (result-thread r)))
                  (when thread
                    (sb-thread:join-thread thread)))))
  -    (let* ((first-results (sbcl-run-spec spec input output error nil nil nil))
  +    (let* ((first-results (generic-run-spec spec input output error nil nil nil))
              (full-results (alexandria:flatten (nconc first-results
                                                      (loop :for r :in first-results
                                                         :nconc (process-result-list r))))))
  
positive.code:                                :input input :output r-output :error error
                                 :predicate predicate :rest rest :resume resume))))))
  
  (defmethod sbcl-run-spec ((spec or-spec) input output error predicate rest resume)
    (list (make-instance 'result :predicate #'result-or :input input :output output
                         :error error :rest (sequence-processes spec) :resume resume)))
  
  (defmethod sbcl-run-spec ((spec and-spec) input output error predicate rest resume)
    (list (make-instance 'result :predicate #'result-and :input input :output output
                         :error error :rest (sequence-processes spec) :resume resume)))
  
  (defmethod sbcl-run-spec ((spec progn-spec) input output error predicate rest resume)
    (list (make-instance 'result :predicate nil :input input :output output
                         :error error :rest (sequence-processes spec) :resume resume)))
  
  (defmethod sbcl-run-spec ((spec fork-spec) input output error predicate rest resume)
    (loop :for p :in (sequence-processes spec) :do
       (sbcl-run-spec p input output error nil nil nil))
    nil)
  
  (defun make-pipe ()
    (multiple-value-bind (fd1 fd2) 
        (sb-unix:unix-pipe)
      (values (sb-sys:make-fd-stream fd1 :buffering :none)
              (sb-sys:make-fd-stream fd2 :buffering :none))))
  
  (defmethod sbcl-run-spec ((spec pipe-spec) input output error predicate rest resume)
    (let ((processes (sequence-processes spec))
          (r-input)
          (r-output)
          (first t)
          (results)
          (*streams-to-close* nil))
      (loop :for (p . rest) :on processes :do
         (cond
           ((and (listp rest) first)  ;; first process
            (setf first nil)
            (multiple-value-setq (r-output r-input) (make-pipe))
            (push r-input *streams-to-close*)
            (push r-output *streams-to-close*)
            (push (sbcl-run-spec p input r-input error nil nil nil) results))
           ((null rest)       ;; last process
            (push (sbcl-run-spec p r-output output error nil nil nil) results))
           (t                 ;; middle of the pipeline
            (multiple-value-bind (left right) (make-pipe)
              (push left *streams-to-close*)
              (push right *streams-to-close*)
              (push (sbcl-run-spec p r-output right error nil nil nil) results)
              (setf r-output left)))))
      (close-streams)
      results))
  
  (defmethod process-result ((r result))
    (labels ((eval-pred (pred rest)
  
negative.code:       (if (or (not process)
                (eval-pred predicate rest))
            (let ((next (car rest)))
              (generic-run-spec next input output error predicate (cdr rest)
                                (if (typep next 'sequence-spec)
                                    r
                                    resume)))
            (when resume
              (with-slots (predicate rest resume input output error) resume
                (when (and (consp rest) (consp (cdr rest)))
                  (let ((remainder (cdr rest)))
                    (when (eval-pred predicate remainder)
                      (generic-run-spec (second rest) input output error
                                        predicate (cddr rest) resume))))))))))
  
  (defun process-result-list (rl)
    (if (listp rl)
  