[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash f3b0a55 321/426: Change -predicate-p examples to -
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash f3b0a55 321/426: Change -predicate-p examples to -predicate? to maintain consistency |
Date: |
Tue, 04 Aug 2015 19:38:35 +0000 |
branch: externals/dash
commit f3b0a55b62a64c8513e340daf59d6d6b3f202e7a
Author: Matus Goljer <address@hidden>
Commit: Matus Goljer <address@hidden>
Change -predicate-p examples to -predicate? to maintain consistency
---
README.md | 30 +++++++++++++++---------------
dash.el | 16 ++++++++--------
dev/examples.el | 36 ++++++++++++++++++------------------
3 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/README.md b/README.md
index 3ab0bd7..b6fcc96 100644
--- a/README.md
+++ b/README.md
@@ -90,9 +90,9 @@ Operations dual to reductions, building lists from seed value
rather than consum
* [-only-some?](#-only-some-pred-list) `(pred list)`
* [-contains?](#-contains-list-element) `(list element)`
* [-same-items?](#-same-items-list-list2) `(list list2)`
-* [-is-prefix-p](#-is-prefix-p-prefix-list) `(prefix list)`
-* [-is-suffix-p](#-is-suffix-p-suffix-list) `(suffix list)`
-* [-is-infix-p](#-is-infix-p-infix-list) `(infix list)`
+* [-is-prefix?](#-is-prefix-prefix-list) `(prefix list)`
+* [-is-suffix?](#-is-suffix-suffix-list) `(suffix list)`
+* [-is-infix?](#-is-infix-infix-list) `(infix list)`
### Partitioning
@@ -725,36 +725,36 @@ The order of the elements in the lists does not matter.
(-same-items? '(1 2 3) '(1 2 3 4)) ;; => nil
```
-#### -is-prefix-p `(prefix list)`
+#### -is-prefix? `(prefix list)`
Return non-nil if `prefix` is prefix of `list`.
```cl
-(-is-prefix-p '(1 2 3) '(1 2 3 4 5)) ;; => t
-(-is-prefix-p '(1 2 3 4 5) '(1 2 3)) ;; => nil
-(-is-prefix-p '(1 3) '(1 2 3 4 5)) ;; => nil
+(-is-prefix? '(1 2 3) '(1 2 3 4 5)) ;; => t
+(-is-prefix? '(1 2 3 4 5) '(1 2 3)) ;; => nil
+(-is-prefix? '(1 3) '(1 2 3 4 5)) ;; => nil
```
-#### -is-suffix-p `(suffix list)`
+#### -is-suffix? `(suffix list)`
Return non-nil if `suffix` is suffix of `list`.
```cl
-(-is-suffix-p '(3 4 5) '(1 2 3 4 5)) ;; => t
-(-is-suffix-p '(1 2 3 4 5) '(3 4 5)) ;; => nil
-(-is-suffix-p '(3 5) '(1 2 3 4 5)) ;; => nil
+(-is-suffix? '(3 4 5) '(1 2 3 4 5)) ;; => t
+(-is-suffix? '(1 2 3 4 5) '(3 4 5)) ;; => nil
+(-is-suffix? '(3 5) '(1 2 3 4 5)) ;; => nil
```
-#### -is-infix-p `(infix list)`
+#### -is-infix? `(infix list)`
Return non-nil if `infix` is infix of `list`.
This operation runs in `o`(n^2) time
```cl
-(-is-infix-p '(1 2 3) '(1 2 3 4 5)) ;; => t
-(-is-infix-p '(2 3 4) '(1 2 3 4 5)) ;; => t
-(-is-infix-p '(3 4 5) '(1 2 3 4 5)) ;; => t
+(-is-infix? '(1 2 3) '(1 2 3 4 5)) ;; => t
+(-is-infix? '(2 3 4) '(1 2 3 4 5)) ;; => t
+(-is-infix? '(3 4 5) '(1 2 3 4 5)) ;; => t
```
diff --git a/dash.el b/dash.el
index 0999736..0f1eebc 100644
--- a/dash.el
+++ b/dash.el
@@ -1169,29 +1169,29 @@ The order of the elements in the lists does not matter."
(defalias '-same-items-p '-same-items?)
-(defun -is-prefix-p (prefix list)
+(defun -is-prefix? (prefix list)
"Return non-nil if PREFIX is prefix of LIST."
(--each-while list (equal (car prefix) it)
(!cdr prefix))
(not prefix))
-(defun -is-suffix-p (suffix list)
+(defun -is-suffix? (suffix list)
"Return non-nil if SUFFIX is suffix of LIST."
- (-is-prefix-p (nreverse suffix) (nreverse list)))
+ (-is-prefix? (nreverse suffix) (nreverse list)))
-(defun -is-infix-p (infix list)
+(defun -is-infix? (infix list)
"Return non-nil if INFIX is infix of LIST.
This operation runs in O(n^2) time"
(let (done)
(while (and (not done) list)
- (setq done (-is-prefix-p infix list))
+ (setq done (-is-prefix? infix list))
(!cdr list))
done))
-(defalias '-is-prefix? '-is-prefix-p)
-(defalias '-is-suffix? '-is-suffix-p)
-(defalias '-is-infix? '-is-infix-p)
+(defalias '-is-prefix-p '-is-prefix?)
+(defalias '-is-suffix-p '-is-suffix?)
+(defalias '-is-infix-p '-is-infix?)
(defun -sort (comparator list)
"Sort LIST, stably, comparing elements using COMPARATOR.
diff --git a/dev/examples.el b/dev/examples.el
index b386d7c..2f71f99 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -273,24 +273,24 @@
(-same-items? '((a . 1) (b . 2)) '((a . 1) (b . 2))) => t
(-same-items? '(1 2 3) '(2 3 1)) => t)
- (defexamples -is-prefix-p
- (-is-prefix-p '(1 2 3) '(1 2 3 4 5)) => t
- (-is-prefix-p '(1 2 3 4 5) '(1 2 3)) => nil
- (-is-prefix-p '(1 3) '(1 2 3 4 5)) => nil
- (-is-prefix-p '(1 2 3) '(1 2 4 5)) => nil)
-
- (defexamples -is-suffix-p
- (-is-suffix-p '(3 4 5) '(1 2 3 4 5)) => t
- (-is-suffix-p '(1 2 3 4 5) '(3 4 5)) => nil
- (-is-suffix-p '(3 5) '(1 2 3 4 5)) => nil
- (-is-suffix-p '(3 4 5) '(1 2 3 5)) => nil)
-
- (defexamples -is-infix-p
- (-is-infix-p '(1 2 3) '(1 2 3 4 5)) => t
- (-is-infix-p '(2 3 4) '(1 2 3 4 5)) => t
- (-is-infix-p '(3 4 5) '(1 2 3 4 5)) => t
- (-is-infix-p '(2 3 4) '(1 2 4 5)) => nil
- (-is-infix-p '(2 4) '(1 2 3 4 5)) => nil))
+ (defexamples -is-prefix?
+ (-is-prefix? '(1 2 3) '(1 2 3 4 5)) => t
+ (-is-prefix? '(1 2 3 4 5) '(1 2 3)) => nil
+ (-is-prefix? '(1 3) '(1 2 3 4 5)) => nil
+ (-is-prefix? '(1 2 3) '(1 2 4 5)) => nil)
+
+ (defexamples -is-suffix?
+ (-is-suffix? '(3 4 5) '(1 2 3 4 5)) => t
+ (-is-suffix? '(1 2 3 4 5) '(3 4 5)) => nil
+ (-is-suffix? '(3 5) '(1 2 3 4 5)) => nil
+ (-is-suffix? '(3 4 5) '(1 2 3 5)) => nil)
+
+ (defexamples -is-infix?
+ (-is-infix? '(1 2 3) '(1 2 3 4 5)) => t
+ (-is-infix? '(2 3 4) '(1 2 3 4 5)) => t
+ (-is-infix? '(3 4 5) '(1 2 3 4 5)) => t
+ (-is-infix? '(2 3 4) '(1 2 4 5)) => nil
+ (-is-infix? '(2 4) '(1 2 3 4 5)) => nil))
(def-example-group "Partitioning" nil
(defexamples -split-at
- [elpa] externals/dash 930b390 278/426: Add -list function., (continued)
- [elpa] externals/dash 930b390 278/426: Add -list function., Phillip Lord, 2015/08/04
- [elpa] externals/dash adaeff7 274/426: Merge pull request #65 from rejeep/same-items-predicate, Phillip Lord, 2015/08/04
- [elpa] externals/dash e6cae0b 279/426: Merge pull request #68 from rejeep/list-function, Phillip Lord, 2015/08/04
- [elpa] externals/dash f18a520 326/426: Release 2.7.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7eb8307 283/426: Merge pull request #71 from Fuco1/find-last-index, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7f0fadc 317/426: Add -prodfn, Phillip Lord, 2015/08/04
- [elpa] externals/dash 960b05f 276/426: Set -each, -each-while and -dotimes indent levels to 1., Phillip Lord, 2015/08/04
- [elpa] externals/dash d948086 315/426: Add -iteratefn, Phillip Lord, 2015/08/04
- [elpa] externals/dash a09a4b2 318/426: Add code markup for docstrings and fix erroneous whitespace in docstring, Phillip Lord, 2015/08/04
- [elpa] externals/dash 38307e3 223/426: Partition docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash f3b0a55 321/426: Change -predicate-p examples to -predicate? to maintain consistency,
Phillip Lord <=
- [elpa] externals/dash 7e4adb5 319/426: Add missing keywords to highlight list, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2ecc073 316/426: Reorder the partition examples to follow more logical order, add tests, Phillip Lord, 2015/08/04
- [elpa] externals/dash eea928a 320/426: Add -replace, Phillip Lord, 2015/08/04
- [elpa] externals/dash d9879e9 329/426: Release 2.8.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash f8873a0 327/426: Update readme-template with changes from last release, Phillip Lord, 2015/08/04
- [elpa] externals/dash 25c114c 330/426: Implementing a shallow copy counterpart to -clone., Phillip Lord, 2015/08/04
- [elpa] externals/dash f257fb9 328/426: Add -butlast, Phillip Lord, 2015/08/04
- [elpa] externals/dash 174747e 323/426: Add -splice and -splice-list, Phillip Lord, 2015/08/04
- [elpa] externals/dash ab99be6 335/426: Add -fix, Phillip Lord, 2015/08/04
- [elpa] externals/dash b1e585d 337/426: Update copyright notice, Phillip Lord, 2015/08/04