replace any-pred? with core function some-fn
This commit is contained in:
parent
5162a23607
commit
03493cf9ca
2 changed files with 13 additions and 19 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
## 0.13.1-SNAPSHOT
|
## 0.13.1-SNAPSHOT
|
||||||
|
|
||||||
* Rename any? in com.rpl.specter.impl to avoid conflict with Clojure 1.9
|
* Remove any? in com.rpl.specter.impl to avoid conflict with Clojure 1.9
|
||||||
|
|
||||||
## 0.13.0
|
## 0.13.0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -527,12 +527,6 @@
|
||||||
(with-meta ret (meta structure))
|
(with-meta ret (meta structure))
|
||||||
ret))))
|
ret))))
|
||||||
|
|
||||||
(defn any-pred?
|
|
||||||
"Accepts any number of predicates that take in one input and returns a new predicate that returns true if any of them are true"
|
|
||||||
[& preds]
|
|
||||||
(fn [obj]
|
|
||||||
(some #(% obj) preds)))
|
|
||||||
|
|
||||||
|
|
||||||
#?(:clj
|
#?(:clj
|
||||||
(do
|
(do
|
||||||
|
|
@ -544,18 +538,18 @@
|
||||||
(eval `(let [~@lv] ~body)))))
|
(eval `(let [~@lv] ~body)))))
|
||||||
|
|
||||||
|
|
||||||
(let [embeddable? (any-pred? number?
|
(let [embeddable? (some-fn number?
|
||||||
symbol?
|
symbol?
|
||||||
keyword?
|
keyword?
|
||||||
string?
|
string?
|
||||||
char?
|
char?
|
||||||
list?
|
list?
|
||||||
vector?
|
vector?
|
||||||
set?
|
set?
|
||||||
#(and (map? %) (not (record? %)))
|
#(and (map? %) (not (record? %)))
|
||||||
nil?
|
nil?
|
||||||
#(instance? clojure.lang.Cons %)
|
#(instance? clojure.lang.Cons %)
|
||||||
#(instance? clojure.lang.LazySeq %))]
|
#(instance? clojure.lang.LazySeq %))]
|
||||||
(defn eval+
|
(defn eval+
|
||||||
"Automatically extracts non-evalable stuff into a closure and then evals"
|
"Automatically extracts non-evalable stuff into a closure and then evals"
|
||||||
[form]
|
[form]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue