]> code.delx.au - gnu-emacs/commitdiff
* doc/lispref/sequences.texi: Add documentation for seq-map-indexed
authorNicolas Petton <nicolas@petton.fr>
Sun, 14 Feb 2016 09:28:26 +0000 (10:28 +0100)
committerNicolas Petton <nicolas@petton.fr>
Sun, 14 Feb 2016 09:33:13 +0000 (10:33 +0100)
doc/lispref/sequences.texi

index 9869fe4c510f9f8b1f44bd77a6a992d4cd8594f6..002a9ceceec43befde7e8729d242d54d12e1bd99 100644 (file)
@@ -572,6 +572,21 @@ element of @var{sequence}.  The returned value is a list.
 @end example
 @end defun
 
+@defun seq-map-indexed function sequence
+  This function returns the result of applying @var{function} to each
+element of @var{sequence} and its index within @var{seq}.  The
+returned value is a list.
+
+@example
+@group
+(seq-map-indexed (lambda (elt idx)
+                   (list idx elt))
+                 '(a b c))
+@result{} ((0 a) (b 1) (c 2))
+@end group
+@end example
+@end defun
+
 @defun seq-mapn function &rest sequences
   This function returns the result of applying @var{function} to each
 element of @var{sequences}.  The arity of @var{function} must match