]> git.eshelyaron.com Git - emacs.git/commit
Add `take` and `ntake` (bug#56521)
authorMattias Engdegård <mattiase@acm.org>
Wed, 13 Jul 2022 11:46:52 +0000 (13:46 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sun, 17 Jul 2022 15:35:49 +0000 (17:35 +0200)
commitd62766305ad8fe6ca1695341c34b9836d051e3cb
tree3bb041d82a695bc4746d7c8f0fe79939ec80d0bc
parent637436970f34f860d50f73a514b3bafd0c5cace7
Add `take` and `ntake` (bug#56521)

These are useful list primitives, complementary to `nthcdr`.

* src/fns.c (Ftake, Fntake): New.
(syms_of_fns): Defsubr them.
* doc/lispref/lists.texi (List Elements):
* lisp/emacs-lisp/shortdoc.el (list): Document.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns, pure-fns):
Declare `take` pure and side-effect-free.
* test/src/fns-tests.el (fns-tests--take-ref, fns--take-ntake):
New test.
* etc/NEWS: Announce.
doc/lispref/lists.texi
etc/NEWS
lisp/emacs-lisp/byte-opt.el
lisp/emacs-lisp/shortdoc.el
src/fns.c
test/src/fns-tests.el