+ (cond
+ ((listp seq)
+ (if b
+ (let ((diff (- b a)))
+ (cond
+ ((zerop diff) ())
+ ((minusp diff)
+ (error "Start index must be smaller than end index"))
+ (t
+ (let* ((drop-a (copy-list (nthcdr a seq)))
+ (pointer drop-a))
+ (dotimes (_ (1- diff))
+ (setq pointer (cdr pointer))
+ (when (null pointer)
+ (error "Ending index larger than length of list")))
+ (rplacd pointer ())
+ drop-a))))
+ (copy-list (nthcdr a seq))))
+ ((arrayp seq)
+ (if b
+ (slice seq a b)
+ (slice seq a)))
+ (t (not-seq-error seq))))