anchor.diff:    (with-slots (cmd-prefix cmd-word cmd-name cmd-suffix) sy
       (multiple-value-bind (assignments arguments redirects) (simple-command-parts sy)
         (format *standard-output* "EXEC: ~A ~A ~A~%" assignments arguments redirects)
  -      (shadow-fd-bindings
  +      (with-fd-scope ()
           (dolist (r redirects)
             (handle-redirect r))
  -        (let ((pid (fork-exec (coerce (mapcar 'token-value arguments) 'vector) :fd-map *fd-bindings* :managed-fds *managed-fds*)))
  +        (let ((pid (run (coerce (mapcar 'token-value arguments) 'vector) :fd-alist (reverse *fd-bindings*) :managed-fds (autoclosed-fds))))
             (process-from-pid pid))))))
   
   (define-condition not-a-thunk (warning)
  
positive.code: (defun process-from-pid (pid)
    (make-instance 'process :pid pid))
  
  (defclass pipeline-process (eval-thunk)
    ((processes)))
  
  (defun separator-par-p (separator)
    (check-type separator separator)
    (with-slots (separator-op) separator
      (when (slot-boundp separator 'separator-op)
        (typep separator-op 'par))))
  
  (defparameter *fd-bindings* (make-hash-table))
  
  (defparameter *fds-to-close-for-shadow* nil)
  
  (defparameter *managed-fds* (make-hash-table))
  (defun fd-is-managed (fd)
    (setf (gethash fd *managed-fds*) t))
  (defun forget-managed-fd (fd)
    (remhash fd *managed-fds*))
  (defun managed-fds ()
    (hash-table-keys *managed-fds*))
  
  (defmacro shadow-fd-bindings (&body body)
    (let ((fd (gensym "FD")))
      `(let ((*fd-bindings* (copy-hash-table *fd-bindings*))
             *fds-to-close-for-shadow*)
         (unwind-protect (progn ,@body)
           (dolist (,fd *fds-to-close-for-shadow*)
             (forget-managed-fd ,fd)
             (sb-posix:close ,fd))))))
  
  (defgeneric open-args-for-redirect (redirect))
  (defmethod open-args-for-redirect ((r less))
  
negative.code:     :type string))
    (:report (lambda (c s) (format s "NOT-IMPLEMENTED ~A~%" (not-implemented-message c)))))
  
  (defparameter *fd-bindings* nil)
  (defparameter *fds-in-scope* nil)
  (defparameter *autoclosed-fds* nil)
  
  (defun autoclose-fd (fd)
    (push fd *autoclosed-fds*)
    (push fd *fds-in-scope*))
  (defun autoclosed-fds ()
    *autoclosed-fds*)
  
  (defmacro with-fd-scope (() &body body)
    (let ((fd (gensym "FD")))
      `(let ((*fd-bindings* *fd-bindings*)
             (*autoclosed-fds* *autoclosed-fds*)
             *fds-in-scope*)
         (unwind-protect (progn ,@body)
           (dolist (,fd *fds-in-scope*)
             (format *error-output* "CLOSE ~A~%" ,fd)
             (sb-posix:close ,fd))))))
  
  (defmacro with-pipe ((read-end write-end) &body body)
    `(with-fd-scope ()
       (multiple-value-bind (,read-end ,write-end) (sb-posix:pipe)
         (format *error-output* "PIPE ~A -> ~A~%" write-end read-end)
         (autoclose-fd ,read-end)
         (autoclose-fd ,write-end)
         ,@body)))
  
  (defclass eval-thunk ()
    ())
  