[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 51d840a: Rename seq-p and map-p to seqp and mapp
From: |
Nicolas Petton |
Subject: |
[Emacs-diffs] master 51d840a: Rename seq-p and map-p to seqp and mapp |
Date: |
Wed, 11 Nov 2015 17:33:27 +0000 |
branch: master
commit 51d840a8a13105172211bb25d36f594aff377d8e
Author: Nicolas Petton <address@hidden>
Commit: Nicolas Petton <address@hidden>
Rename seq-p and map-p to seqp and mapp
* lisp/emacs-lisp/seq.el (seqp): New name.
* lisp/emacs-lisp/map.el (mapp): New name.
* doc/lispref/sequences.texi: Update the documentation for seqp.
* test/automated/map-tests.el: Update the tests for mapp.
---
doc/lispref/sequences.texi | 6 +++---
lisp/emacs-lisp/map.el | 6 +++---
lisp/emacs-lisp/seq.el | 10 +++++-----
test/automated/map-tests.el | 20 ++++++++++----------
4 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 84a7c32..66d88e4 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -467,18 +467,18 @@ built-in sequence types, @code{seq-length} behaves like
@code{length}.
@xref{Definition of length}.
@end defun
address@hidden seq-p sequence
address@hidden seqp sequence
This function returns address@hidden if @var{sequence} is a sequence
(a list or array), or any additional type of sequence defined via
@file{seq.el} generic functions.
@example
@group
-(seq-p [1 2])
+(seqp [1 2])
@result{} t
@end group
@group
-(seq-p 2)
+(seqp 2)
@result{} nil
@end group
@end example
diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el
index 7ff9031..98a3565 100644
--- a/lisp/emacs-lisp/map.el
+++ b/lisp/emacs-lisp/map.el
@@ -58,7 +58,7 @@ unquoted form.
ARGS can also be a list of symbols, which stands for ('SYMBOL
SYMBOL)."
- `(and (pred map-p)
+ `(and (pred mapp)
,@(map--make-pcase-bindings args)))
(defmacro map-let (keys map &rest body)
@@ -155,7 +155,7 @@ MAP can be a list, hash-table or array."
Map can be a nested map composed of alists, hash-tables and arrays."
(or (seq-reduce (lambda (acc key)
- (when (map-p acc)
+ (when (mapp acc)
(map-elt acc key)))
keys
map)
@@ -239,7 +239,7 @@ MAP can be a list, hash-table or array."
(map-filter (lambda (key val) (not (funcall pred key val)))
map))
-(defun map-p (map)
+(defun mapp (map)
"Return non-nil if MAP is a map (list, hash-table or array)."
(or (listp map)
(hash-table-p map)
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index 6826509..456efd0 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -4,7 +4,7 @@
;; Author: Nicolas Petton <address@hidden>
;; Keywords: sequences
-;; Version: 2.2
+;; Version: 2.3
;; Package: seq
;; Maintainer: address@hidden
@@ -46,7 +46,7 @@
;; - `seq-elt'
;; - `seq-length'
;; - `seq-do'
-;; - `seq-p'
+;; - `seqp'
;; - `seq-subseq'
;; - `seq-into-sequence'
;; - `seq-copy'
@@ -79,7 +79,7 @@ corresponding element of SEQUENCE.
Extra elements of the sequence are ignored if fewer PATTERNS are
given, and the match does not fail."
- `(and (pred seq-p)
+ `(and (pred seqp)
,@(seq--make-pcase-bindings patterns)))
(defmacro seq-let (args sequence &rest body)
@@ -117,7 +117,7 @@ Return SEQUENCE."
(defalias 'seq-each #'seq-do)
-(cl-defgeneric seq-p (sequence)
+(cl-defgeneric seqp (sequence)
"Return non-nil if SEQUENCE is a sequence, nil otherwise."
(sequencep sequence))
@@ -433,7 +433,7 @@ SEQUENCE must be a sequence of numbers or markers."
"Return a list of `(seq ...)' pcase patterns from the argument list ARGS."
(cons 'seq
(seq-map (lambda (elt)
- (if (seq-p elt)
+ (if (seqp elt)
(seq--make-pcase-patterns elt)
elt))
args)))
diff --git a/test/automated/map-tests.el b/test/automated/map-tests.el
index 1a759b5..2a7fcc3 100644
--- a/test/automated/map-tests.el
+++ b/test/automated/map-tests.el
@@ -126,16 +126,16 @@ Evaluate BODY for each created map.
(should (null (map-nested-elt vec '(2 1 1))))
(should (= 4 (map-nested-elt vec '(2 1 1) 4)))))
-(ert-deftest test-map-p ()
- (should (map-p nil))
- (should (map-p '((a . b) (c . d))))
- (should (map-p '(a b c d)))
- (should (map-p []))
- (should (map-p [1 2 3]))
- (should (map-p (make-hash-table)))
- (should (map-p "hello"))
- (should (not (map-p 1)))
- (should (not (map-p 'hello))))
+(ert-deftest test-mapp ()
+ (should (mapp nil))
+ (should (mapp '((a . b) (c . d))))
+ (should (mapp '(a b c d)))
+ (should (mapp []))
+ (should (mapp [1 2 3]))
+ (should (mapp (make-hash-table)))
+ (should (mapp "hello"))
+ (should (not (mapp 1)))
+ (should (not (mapp 'hello))))
(ert-deftest test-map-keys ()
(with-maps-do map
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 51d840a: Rename seq-p and map-p to seqp and mapp,
Nicolas Petton <=