anchor.diff:  :count is supplied. The second return value is an index suitable as an
   argument to CL:SUBSEQ into the sequence indicating where processing
   stopped."
  -  (let ((len (length seq))
  -        (other-keys (nconc (when test-supplied 
  -                             (list :test test))
  -                           (when test-not-supplied 
  -                             (list :test-not test-not))
  -                           (when key-supplied 
  -                             (list :key key)))))
  -    (unless end (setq end len))
  -    (if from-end
  -        (loop for right = end then left
  -              for left = (max (or (apply #'position delimiter seq 
  -					 :end right
  -					 :from-end t
  -					 other-keys)
  -				  -1)
  -			      (1- start))
  -              unless (and (= right (1+ left))
  -                          remove-empty-subseqs) ; empty subseq we don't want
  -              if (and count (>= nr-elts count))
  -              ;; We can't take any more. Return now.
  -              return (values (nreverse subseqs) right)
  -              else 
  -              collect (subseq seq (1+ left) right) into subseqs
  -              and sum 1 into nr-elts
  -              until (< left start)
  -              finally (return (values (nreverse subseqs) (1+ left))))
  -      (loop for left = start then (+ right 1)
  -            for right = (min (or (apply #'position delimiter seq 
  -					:start left
  -					other-keys)
  -				 len)
  -			     end)
  -            unless (and (= right left) 
  -                        remove-empty-subseqs) ; empty subseq we don't want
  -            if (and count (>= nr-elts count))
  -            ;; We can't take any more. Return now.
  -            return (values subseqs left)
  -            else
  -            collect (subseq seq left right) into subseqs
  -            and sum 1 into nr-elts
  -            until (>= right end)
  -            finally (return (values subseqs right))))))
  +    (check-bounds sequence start end)
  +    (cond
  +      ((and (not from-end) (null test-not))
  +       (split-from-start (lambda (sequence start)
  +                           (position delimiter sequence :start start :key key :test test))
  +                         sequence start end count remove-empty-subseqs))
  +      ((and (not from-end) test-not)
  +       (split-from-start (lambda (sequence start)
  +                           (position delimiter sequence :start start :key key :test-not test-not))
  +                         sequence start end count remove-empty-subseqs))
  +      ((and from-end (null test-not))
  +       (split-from-end (lambda (sequence end)
  +                         (position delimiter sequence :end end :from-end t :key key :test test))
  +                       sequence start end count remove-empty-subseqs))
  +      ((and from-end test-not)
  +       (split-from-end (lambda (sequence end)
  +                         (position delimiter sequence :end end :from-end t :key key :test-not test-not))
  +                       sequence start end count remove-empty-subseqs))))
   
  -(defun split-sequence-if (predicate seq &key (count nil) (remove-empty-subseqs nil) (from-end nil) (start 0) (end nil) (key nil key-supplied))
  -  "Return a list of subsequences in seq delimited by items satisfying
  +  (defun split-sequence-if (predicate sequence &key (start 0) (end nil) (from-end nil)
  +                            (count nil) (remove-empty-subseqs nil) (key #'identity))
  +    "Return a list of subsequences in seq delimited by items satisfying
   predicate.
   
   If :remove-empty-subseqs is NIL, empty subsequences will be included
  
positive.code: :count is supplied. The second return value is an index suitable as an
  argument to CL:SUBSEQ into the sequence indicating where processing
  stopped."
    (let ((len (length seq))
  	(other-keys (when key-supplied 
  		      (list :key key))))
      (unless end (setq end len))
      (if from-end
          (loop for right = end then left
                for left = (max (or (apply #'position-if-not predicate seq 
  					 :end right
  					 :from-end t
  					 other-keys)
  				  -1)
  			      (1- start))
                unless (and (= right (1+ left))
                            remove-empty-subseqs) ; empty subseq we don't want
                if (and count (>= nr-elts count))
                ;; We can't take any more. Return now.
                return (values (nreverse subseqs) right)
                else 
                collect (subseq seq (1+ left) right) into subseqs
                and sum 1 into nr-elts
                until (< left start)
                finally (return (values (nreverse subseqs) (1+ left))))
        (loop for left = start then (+ right 1)
              for right = (min (or (apply #'position-if-not predicate seq 
  					:start left
  					other-keys)
  				 len)
  			     end)
              unless (and (= right left) 
                          remove-empty-subseqs) ; empty subseq we don't want
              if (and count (>= nr-elts count))
              ;; We can't take any more. Return now.
              return (values subseqs left)
              else
              collect (subseq seq left right) into subseqs
              and sum 1 into nr-elts
              until (>= right end)
              finally (return (values subseqs right))))))
  
  (pushnew :split-sequence *features*)
  
negative.code: 
  (in-package :split-sequence)
  
  (macrolet ((check-bounds (sequence start end)
               (with-gensyms (length)
                 `(let ((,length (length ,sequence)))
                    (check-type ,start unsigned-byte "a non-negative integer")
                    (when ,end (check-type ,end unsigned-byte "a non-negative integer or NIL"))
                    (unless ,end
                      (setf ,end ,length))
                    (unless (<= ,start ,end ,length)
                      (error "Wrong sequence bounds. start: ~S end: ~S" ,start ,end))))))
  
    (defun split-sequence (delimiter sequence &key (start 0) (end nil) (from-end nil)
                           (count nil) (remove-empty-subseqs nil)
                           (test #'eql) (test-not nil) (key #'identity))
      "Return a list of subsequences in seq delimited by delimiter.
  
  If :remove-empty-subseqs is NIL, empty subsequences will be included
  in the result; otherwise they will be discarded.  All other keywords
  