more fixes

This commit is contained in:
Nathan Marz 2016-08-04 15:03:00 -04:00
parent 73312bffd7
commit 423da1e03f
4 changed files with 37 additions and 36 deletions

View file

@ -465,12 +465,12 @@
afn
(fixed-pathed-nav [late path]
(select* [this structure next-fn]
(n/filter-select
(i/filter-select
#(n/selected?* late %)
structure
next-fn))
(transform* [this structure next-fn]
(n/filter-transform
(i/filter-transform
#(n/selected?* late %)
structure
next-fn)))))
@ -480,12 +480,12 @@
(fn [s] (not (afn s)))
(fixed-pathed-nav [late path]
(select* [this structure next-fn]
(n/filter-select
(i/filter-select
#(n/not-selected?* late %)
structure
next-fn))
(transform* [this structure next-fn]
(n/filter-transform
(i/filter-transform
#(n/not-selected?* late %)
structure
next-fn)))))

View file

@ -416,7 +416,9 @@
)
needs-params-paths (filter #(instance? ParamsNeededPath %) coerced)]
(if (empty? needs-params-paths)
(no-params-rich-compiled-path result-nav)
(if (satisfies? Navigator result-nav)
(lean-compiled-path result-nav)
(no-params-rich-compiled-path result-nav))
(->ParamsNeededPath
(coerce-rich-navigator result-nav)
(->> needs-params-paths
@ -700,6 +702,16 @@
(bind-params* precompiled params 0)
))
(defn filter-select [afn structure next-fn]
(if (afn structure)
(next-fn structure)
NONE))
(defn filter-transform [afn structure next-fn]
(if (afn structure)
(next-fn structure)
structure))
(def pred*
(->ParamsNeededPath
(reify RichNavigator
@ -718,6 +730,24 @@
1
))
(def collected?*
(->ParamsNeededPath
(reify RichNavigator
(rich-select* [this params params-idx vals structure next-fn]
(let [afn (aget ^objects params params-idx)]
(if (afn vals)
(next-fn params (inc params-idx) vals structure)
NONE
)))
(rich-transform* [this params params-idx vals structure next-fn]
(let [afn (aget ^objects params params-idx)]
(if (afn vals)
(next-fn params (inc params-idx) vals structure)
structure
))))
1
))
(def rich-compiled-path-proxy
(->ParamsNeededPath
(reify RichNavigator

View file

@ -137,9 +137,9 @@
[num-params impl1 impl2]
(let [[[s-params & s-body] [t-params & t-body]] (determine-params-impls impl1 impl2)
s-next-fn-sym (last s-params)
s-pidx-sym (second s-params)
s-pidx-sym (nth s-params 2)
t-next-fn-sym (last t-params)
t-pidx-sym (second t-params)
t-pidx-sym (nth t-params 2)
]
`(let [num-params# ~num-params
nav# (reify RichNavigator

View file

@ -307,16 +307,6 @@
(apply afn (conj vals structure)))
))
(defn filter-select [afn structure next-fn]
(if (afn structure)
(next-fn structure)
i/NONE))
(defn filter-transform [afn structure next-fn]
(if (afn structure)
(next-fn structure)
structure))
(defprotocol AddExtremes
(append-all [structure elements])
@ -457,25 +447,6 @@
ret
))))
(def collected?*
(i/->ParamsNeededPath
(reify i/RichNavigator
(rich-select* [this params params-idx vals structure next-fn]
(let [afn (aget ^objects params params-idx)]
(if (afn vals)
(next-fn params (inc params-idx) vals structure)
i/NONE
)))
(rich-transform* [this params params-idx vals structure next-fn]
(let [afn (aget ^objects params params-idx)]
(if (afn vals)
(next-fn params (inc params-idx) vals structure)
structure
))))
1
))
(def DISPENSE*
(i/no-params-rich-compiled-path
(reify i/RichNavigator