anchor.diff:      (assort '(1 2 3) :key #'evenp) => ((1 3) (2))
       (partition #'evenp '(1 2 3)) => (2), (1 3)"
     (fbind ((test (compose pred key)))
  -    (seq-dispatch seq
  -      (progn
  -        (setf seq (nthcdr start seq))
  -        (let ((pass (queue))
  -              (fail (queue)))
  -          (flet ((pass/fail (item)
  -                   (if (test item)
  -                       (enq item pass)
  -                       (enq item fail))))
  -            (declare (dynamic-extent #'pass/fail))
  -            (if (null end)
  -                (dolist (item seq)
  -                  (pass/fail item))
  -                (loop for i from 0 below (- end start)
  -                      for item in seq
  -                      do (pass/fail item))))
  -          (values (qlist pass) (qlist fail))))
  -      ;; Vector.
  -      (progn
  -        (let* ((pass (make-array 0
  -                                 :element-type (array-element-type seq)
  -                                 :adjustable t
  -                                 :fill-pointer 0))
  -               (fail (copy-array pass)))
  -          (loop for i from start below (or end (length seq))
  -                for item = (aref seq i)
  -                do (if (test item)
  -                       (vector-push-extend item pass)
  -                       (vector-push-extend item fail)))
  -          (values pass fail)))
  -      ;; Generic sequence.
  -      (values (remove-if pred seq :key key)
  -              (remove-if-not pred seq :key key)))))
  +    (let ((pass (make-bucket seq))
  +          (fail (make-bucket seq)))
  +      (map-subseq (lambda (item)
  +                    (if (test item)
  +                        (bucket-push seq item pass)
  +                        (bucket-push seq item fail)))
  +                  seq start end)
  +      (values (bucket-seq seq pass) (bucket-seq seq fail)))))
   
   (defun partitions (preds seq &key (start 0) end (key #'identity))
     "Generalized version of PARTITION.
  
positive.code: 
  (defun make-sequence-like (seq len &rest args &key initial-element
                                                     (initial-contents nil ic?))
    (seq-dispatch seq
      (if ic?
          (map 'list #'identity initial-contents)
          (make-list len :initial-element initial-element))
      (apply #'make-array len :element-type (array-element-type seq) args)
      #+(or sbcl abcl) (apply #'sequence:make-sequence-like seq len args)))
  
  (defun nsubseq (seq start &optional end)
    "Return a subsequence that may share structure with SEQ.
  
negative.code:      (keep 'x ((x 1) (y 2) (x 3)) :key #'car)
       => '((x 1) (x 3))"
    (declare (ignore from-end key))
    (let ((args (remove-from-plist args :test)))
      (if (null count)
          (apply #'remove item seq :test-not test args)
          (fbind ((test (curry test item)))
            (declare (dynamic-extent #'test))
            (apply #'filter #'test seq :count count args)))))
  
  (assert (equal '((a 1) (a 2))
                 (keep 'a '((a 1) (b) (c) (a 2) (a 3) (b) (c) (a 4) (a 5))
  