anchor.diff:                               :read-only t))
   
   (defstruct (bulk-task
  -            (:include task)
               (:constructor nil))
     ;; count waiting to be executed
     (waiting   (error "Missing arg") :type word)
     ;; count not done yet
     (remaining (error "Missing arg") :type word)
     (subtasks  (error "Missing arg") :type (simple-array (or symbol function) 1)
  +                                   :read-only t)
  +  (cleanup   nil                   :type (or list function)
                                      :read-only t))
   
   (deftype task-designator ()
  
positive.code: (defun p (x)
    (stack-p x))
  
  (defun bulk-task-hintify (x &optional (hint 0))
    (if (bulk-task-p x)
        (cons (truncate (* hint (length (bulk-task-subtasks x))))
              x)
        x))
  
  (defun push (stack x &optional (hint 0))
    (with-mutex ((stack-lock stack))
  
negative.code:        (let* ((index (position nil data :from-end t
                                          :test-not #'eql))
                (task  (and index (aref data index))))
           (flet ((clear ()
                    (setf (aref data index)   nil
                          (fill-pointer data) index)))
             (declare (inline clear))
             (etypecase task
               (null
                (setf (fill-pointer data) 0)
                (return nil))
               (cons
                (let ((subtask (bulk-find-task task)))
                  (if subtask
                      (let ((bulk-task (cdr task)))
                        (funcall subtask bulk-task)
                        (when (= (atomic-decf (bulk-task-remaining bulk-task))
                                 1)
                          (let ((cleanup (bulk-task-cleanup bulk-task)))
                            (etypecase cleanup
                              (null)
                              (cons
                               (dolist (cleanup cleanup)
                                 (funcall cleanup bulk-task)))
                              ((or function symbol)
                               (funcall cleanup bulk-task))))
                          (clear))
                        (return t))
                      (clear))))
               ((or task symbol function)
                (clear)
                (if (task-p task)
                    (funcall (task-fun task) task)
                    (funcall task))
                (return t)))))))))
  