summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-12-27 09:00:23 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-12-27 09:00:23 +0100
commit0f790464d547dd57a857d88dab309b286067ac45 (patch)
tree9636601e10be40551a54a0c2d403f48ca39db4f3 /doc
parent714ca849ba658405ddde698cdc5836c4c9b289ca (diff)
downloademacs-0f790464d547dd57a857d88dab309b286067ac45.tar.gz
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 'doc')
-rw-r--r--doc/lispref/sequences.texi15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 952834bd4e3..57b49847e7f 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -116,6 +116,21 @@ If you need to compute the width of a string on display, you should use
since @code{length} only counts the number of characters, but does not
account for the display width of each character.
+@defun length< sequence length
+Return non-@code{nil} if @var{sequence} is shorter than @var{length}.
+This may be more efficient than computing the length of @var{sequence}
+if @var{sequence} is a long list.
+@end defun
+
+@defun length> sequence length
+Return non-@code{nil} if @var{sequence} is longer than @var{length}.
+@end defun
+
+@defun length= sequence length
+Return non-@code{nil} if the length of @var{sequence} is equal to
+@var{length}.
+@end defun
+
@defun elt sequence index
@anchor{Definition of elt}
@cindex elements of sequences