]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/seq/seq.el
Rephrases a comment in seq.el about the order of the arguments
[gnu-emacs-elpa] / packages / seq / seq.el
index 5366fd2e01138bf3cb535c24778733eece69ca79..c5f5906e7e58bd490dff803251caa46fca0a4fc5 100644 (file)
@@ -4,7 +4,7 @@
 
 ;; Author: Nicolas Petton <nicolas@petton.fr>
 ;; Keywords: sequences
-;; Version: 1.2
+;; Version: 1.3
 ;; Package: seq
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -33,8 +33,8 @@
 ;;
 ;; All provided functions work on lists, strings and vectors.
 ;;
-;; Functions taking a predicate or a function iterating over the
-;; sequence as argument take the function as their first argument and
+;; Functions taking a predicate or iterating over a sequence using a
+;; function as argument take the function as their first argument and
 ;; the sequence as their second argument.  All other functions take
 ;; the sequence as their first argument.
 ;;
@@ -172,7 +172,7 @@ The result is a sequence of the same type as SEQ."
   (if (listp seq)
       (sort (seq-copy seq) pred)
     (let ((result (seq-sort pred (append seq nil))))
-      (seq--into result (type-of seq)))))
+      (seq-into result (type-of seq)))))
 
 (defun seq-contains-p (seq elt &optional testfn)
   "Return the first element in SEQ that equals to ELT.
@@ -266,10 +266,11 @@ See also the function `nreverse', which is used more often."
                  seq)
         (if (listp seq)
             result
-          (seq--into result (type-of seq)))))))
+          (seq-into result (type-of seq)))))))
 
-(defun seq--into (seq type)
-  "Convert the sequence SEQ into a sequence of type TYPE."
+(defun seq-into (seq type)
+  "Convert the sequence SEQ into a sequence of type TYPE.
+TYPE can be one of the following symbols: vector, string or list."
   (pcase type
     (`vector (vconcat seq))
     (`string (concat seq))