emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 7eb2077 4/4: Add documentation for seq-mapcat, seq-


From: Nicolas Petton
Subject: [Emacs-diffs] master 7eb2077 4/4: Add documentation for seq-mapcat, seq-partition and seq-group-by
Date: Fri, 06 Feb 2015 15:02:21 +0000

branch: master
commit 7eb2077f9dd14ae9d70a12c621151afd50ea6e96
Author: Nicolas Petton <address@hidden>
Commit: Nicolas Petton <address@hidden>

    Add documentation for seq-mapcat, seq-partition and seq-group-by
    
    * doc/lispref/sequences.texi (Sequence Functions): Add documentation
    for seq-mapcat, seq-partition and seq-group-by
---
 doc/lispref/ChangeLog      |    5 ++++
 doc/lispref/sequences.texi |   47 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 51 insertions(+), 1 deletions(-)

diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index e928d19..3fe3d6f 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-06  Nicolas Petton <address@hidden>
+
+       * sequences.texi (Sequence Functions): Add documentation for
+       seq-mapcat, seq-partition and seq-group-by.
+
 2015-02-05  Martin Rudalics  <address@hidden>
 
        * display.texi (Size of Displayed Text): Remove description of
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index f82c496..f268c0d 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -695,9 +695,54 @@ concatenation of @var{sequences}.  @var{type} may be: 
@code{vector},
 @end example
 @end defun
 
address@hidden seq-mapcat function sequence &optional type
+  This function returns the result of applying @code{seq-concatenate}
+to the result of applying @var{function} to each element of
address@hidden  The result is a sequence of type @var{type}, or a
+list if @var{type} is @code{nil}.
+
address@hidden
address@hidden
+(seq-mapcat #'seq-reverse '((3 2 1) (6 5 4)))
address@hidden (1 2 3 4 5 6)
address@hidden group
address@hidden example
address@hidden defun
+
address@hidden seq-partition sequence n
+  This function returns a list of the elements of @var{sequence}
+grouped into sub-sequences of length @var{n}.  The last sequence may
+contain less elements than @var{n}.  @var{n} must be an integer.  If
address@hidden is a negative integer or 0, nil is returned.
+
address@hidden
address@hidden
+(seq-partition '(0 1 2 3 4 5 6 7) 3)
address@hidden ((0 1 2) (3 4 5) (6 7))
address@hidden group
address@hidden example
address@hidden defun
+
address@hidden seq-group-by function sequence
+  This function separates the elements of @var{sequence} into an alist
+whose keys are the result of applying @var{function} to each element
+of @var{sequence}.  Keys are compared using @code{equal}.
+
address@hidden
address@hidden
+(seq-group-by #'integerp '(1 2.1 3 2 3.2))
address@hidden ((t 2 3 1) (nil 3.2 2.1))
address@hidden group
address@hidden
+(seq-group-by #'car '((a 1) (b 2) (a 3) (c 4)))
address@hidden ((a (a 3) (a 1)) (b (b 2)) (c (c 4)))
address@hidden group
address@hidden example
address@hidden defun
+
 @defmac seq-doseq (var sequence [result]) address@hidden
 @cindex sequence iteration
-This macro is like @code{dolist}, except that @var{sequence} can be a list,
+  This macro is like @code{dolist}, except that @var{sequence} can be a list,
 vector or string (@pxref{Iteration} for more information about the
 @code{dolist} macro).  This is primarily useful for side-effects.
 @end defmac



reply via email to

[Prev in Thread] Current Thread [Next in Thread]