fix ALL on all kinds of lists, lazy seqs, etc. 0.0.5
This commit is contained in:
parent
aca0fa4b5e
commit
857cd04711
3 changed files with 7 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
(defproject com.rpl/specter "0.0.4"
|
(defproject com.rpl/specter "0.0.5"
|
||||||
:dependencies [[org.clojure/clojure "1.6.0"]
|
:dependencies [[org.clojure/clojure "1.6.0"]
|
||||||
]
|
]
|
||||||
:jvm-opts ["-XX:-OmitStackTraceInFastThrow"] ; this prevents JVM from doing optimizations which can remove stack traces from NPE and other exceptions
|
:jvm-opts ["-XX:-OmitStackTraceInFastThrow"] ; this prevents JVM from doing optimizations which can remove stack traces from NPE and other exceptions
|
||||||
|
|
|
||||||
|
|
@ -142,11 +142,11 @@
|
||||||
(select* [this vals structure next-fn]
|
(select* [this vals structure next-fn]
|
||||||
(into [] (r/mapcat (partial next-fn vals) structure)))
|
(into [] (r/mapcat (partial next-fn vals) structure)))
|
||||||
(update* [this vals structure next-fn]
|
(update* [this vals structure next-fn]
|
||||||
(let [ret (r/map (partial next-fn vals) structure)
|
(let [empty-structure (empty structure)
|
||||||
res (into (empty structure) ret)]
|
pfn (partial next-fn vals)]
|
||||||
(if (list? structure)
|
(if (list? empty-structure)
|
||||||
(reverse res)
|
(map pfn structure)
|
||||||
res
|
(->> structure (r/map pfn) (into empty-structure))
|
||||||
))))
|
))))
|
||||||
|
|
||||||
(deftype ValStructurePath []
|
(deftype ValStructurePath []
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
(for-all+
|
(for-all+
|
||||||
[v (gen/list gen/int)]
|
[v (gen/list gen/int)]
|
||||||
(let [v2 (update [ALL] inc v)]
|
(let [v2 (update [ALL] inc v)]
|
||||||
(and (list? v2) (= v2 (map inc v)))
|
(and (seq? v2) (= v2 (map inc v)))
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(defspec update-all-filter
|
(defspec update-all-filter
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue