Function: seq-take
seq-take is an autoloaded and byte-compiled function defined in
seq-25.el.
Signature
(seq-take SEQUENCE N)
Documentation
Return the sequence made of the first N elements of SEQUENCE.
The result is a sequence of the same type as SEQUENCE.
If N is a negative integer or zero, an empty sequence is returned.
Other relevant functions are documented in the sequence group.
Shortdoc
;; sequence
(seq-take '(a b c d e) 3)
=> (a b c)
Aliases
recentf-trunc-list (obsolete since 28.1)
Implementations
((list list) n) in `seq-25.el'.
Optimized implementation of `seq-take' for lists.
(sequence n) in `seq-25.el'.
Undocumented
Source Code
;; Defined in ~/.emacs.d/elpa/seq-2.24/seq-25.el
;;;###autoload
(cl-defgeneric seq-take (sequence n)
"Return the sequence made of the first N elements of SEQUENCE.
The result is a sequence of the same type as SEQUENCE.
If N is a negative integer or zero, an empty sequence is
returned."
(seq-subseq sequence 0 (min (max n 0) (seq-length sequence))))