Function: cl-subseq

cl-subseq is an autoloaded and byte-compiled function defined in cl-extra.el.gz.

Signature

(cl-subseq SEQ START &optional END)

Documentation

Return the subsequence of SEQ from START to END.

If END is omitted, it defaults to the length of the sequence. If START or END is negative, it counts from the end. Signal an error if START or END are outside of the sequence (i.e too large if positive or too small if negative).

Aliases

viper-subseq (obsolete since 28.1) subseq (obsolete since 27.1)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-extra.el.gz
;;; Sequence functions.

;;;###autoload
(defun cl-subseq (seq start &optional end)
  "Return the subsequence of SEQ from START to END.
If END is omitted, it defaults to the length of the sequence.
If START or END is negative, it counts from the end.
Signal an error if START or END are outside of the sequence (i.e
too large if positive or too small if negative)."
  (declare (gv-setter
            (lambda (new)
              (macroexp-let2 nil new new
		`(progn (cl-replace ,seq ,new :start1 ,start :end1 ,end)
			,new)))))
  (seq-subseq seq start end))