[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash f3b0a55 321/439: Change -predicate-p examples to -
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash f3b0a55 321/439: Change -predicate-p examples to -predicate? to maintain consistency |
Date: |
Tue, 04 Aug 2015 20:29:39 +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 7185db8 311/439: [Issue #83] Add `step` to `-slice`, (continued)
- [elpa] externals/dash 7185db8 311/439: [Issue #83] Add `step` to `-slice`, Phillip Lord, 2015/08/04
- [elpa] externals/dash a3021eb 313/439: Merge pull request #93 from lunaryorn/patch-1, Phillip Lord, 2015/08/04
- [elpa] externals/dash 624c501 306/439: Add `-table` and `-table-flat`, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0384eee 312/439: Improve Travis CI configuration, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3132ae0 314/439: Alias -tail to nthcdr, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2ecc073 316/439: Reorder the partition examples to follow more logical order, add tests, Phillip Lord, 2015/08/04
- [elpa] externals/dash bbc1d9c 309/439: `--each-while` should also expose `it-index`, Phillip Lord, 2015/08/04
- [elpa] externals/dash d948086 315/439: Add -iteratefn, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7f0fadc 317/439: Add -prodfn, Phillip Lord, 2015/08/04
- [elpa] externals/dash eea928a 320/439: Add -replace, Phillip Lord, 2015/08/04
- [elpa] externals/dash f3b0a55 321/439: Change -predicate-p examples to -predicate? to maintain consistency,
Phillip Lord <=
- [elpa] externals/dash a09a4b2 318/439: Add code markup for docstrings and fix erroneous whitespace in docstring, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7e4adb5 319/439: Add missing keywords to highlight list, Phillip Lord, 2015/08/04
- [elpa] externals/dash 174747e 323/439: Add -splice and -splice-list, Phillip Lord, 2015/08/04
- [elpa] externals/dash 5637bd6 322/439: Add alias from -find to -first, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9ebcce6 325/439: Add some niceties to font-locking of examples, Phillip Lord, 2015/08/04
- [elpa] externals/dash f8873a0 327/439: Update readme-template with changes from last release, Phillip Lord, 2015/08/04
- [elpa] externals/dash f18a520 326/439: Release 2.7.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash f257fb9 328/439: Add -butlast, Phillip Lord, 2015/08/04
- [elpa] externals/dash d9879e9 329/439: Release 2.8.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 25c114c 330/439: Implementing a shallow copy counterpart to -clone., Phillip Lord, 2015/08/04