1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-09 07:40:39 -08:00

Add new predicates for sequence lengths

* doc/lispref/sequences.texi (Sequence Functions): Document them.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark them as
side-effect-free.

* lisp/emacs-lisp/shortdoc.el (list): Mention them.

* src/fns.c (Flength): Mention them in the doc string.
(length_internal): New function.
(Flength_less, Flength_greater, Flength_equal): New defuns.
(syms_of_fns): Sym them.
This commit is contained in:
Lars Ingebrigtsen 2020-12-27 09:00:23 +01:00
parent 714ca849ba
commit 0f790464d5
6 changed files with 135 additions and 2 deletions

View file

@ -1169,7 +1169,9 @@
hash-table-count
int-to-string intern-soft isnan
keymap-parent
lax-plist-get ldexp length line-beginning-position line-end-position
lax-plist-get ldexp
length length< length> length=
line-beginning-position line-end-position
local-variable-if-set-p local-variable-p locale-info
log log10 logand logb logcount logior lognot logxor lsh
make-byte-code make-list make-string make-symbol marker-buffer max

View file

@ -618,6 +618,12 @@ There can be any number of :example/:result elements."
"Data About Lists"
(length
:eval (length '(a b c)))
(length<
:eval (lenth< '(a b c) 1))
(length>
:eval (lenth> '(a b c) 1))
(length=
:eval (lenth> '(a b c) 3))
(safe-length
:eval (safe-length '(a b c))))