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"]
|
||||
]
|
||||
: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]
|
||||
(into [] (r/mapcat (partial next-fn vals) structure)))
|
||||
(update* [this vals structure next-fn]
|
||||
(let [ret (r/map (partial next-fn vals) structure)
|
||||
res (into (empty structure) ret)]
|
||||
(if (list? structure)
|
||||
(reverse res)
|
||||
res
|
||||
(let [empty-structure (empty structure)
|
||||
pfn (partial next-fn vals)]
|
||||
(if (list? empty-structure)
|
||||
(map pfn structure)
|
||||
(->> structure (r/map pfn) (into empty-structure))
|
||||
))))
|
||||
|
||||
(deftype ValStructurePath []
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
(for-all+
|
||||
[v (gen/list gen/int)]
|
||||
(let [v2 (update [ALL] inc v)]
|
||||
(and (list? v2) (= v2 (map inc v)))
|
||||
(and (seq? v2) (= v2 (map inc v)))
|
||||
)))
|
||||
|
||||
(defspec update-all-filter
|
||||
|
|
|
|||
Loading…
Reference in a new issue