diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-12-27 09:00:23 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-12-27 09:00:23 +0100 |
commit | 0f790464d547dd57a857d88dab309b286067ac45 (patch) | |
tree | 9636601e10be40551a54a0c2d403f48ca39db4f3 /lisp/emacs-lisp | |
parent | 714ca849ba658405ddde698cdc5836c4c9b289ca (diff) | |
download | emacs-0f790464d547dd57a857d88dab309b286067ac45.tar.gz emacs-0f790464d547dd57a857d88dab309b286067ac45.tar.bz2 emacs-0f790464d547dd57a857d88dab309b286067ac45.zip |
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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/shortdoc.el | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 469bbe6c7c0..0eee6e9d015 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -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 diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 9d183e0d4e9..c6259f89711 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -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)))) |