define pred using defnav so it uses lean navigation when possible
This commit is contained in:
parent
6024195229
commit
9a35c0666d
1 changed files with 6 additions and 2 deletions
|
|
@ -514,11 +514,15 @@
|
|||
(transform* [this structure next-fn]
|
||||
(next-fn (compiled-transform late update-fn structure)))))
|
||||
|
||||
(def
|
||||
(defnav
|
||||
^{:doc "Keeps the element only if it matches the supplied predicate. This is the
|
||||
late-bound parameterized version of using a function directly in a path."}
|
||||
pred
|
||||
i/pred*
|
||||
[afn]
|
||||
(select* [this structure next-fn]
|
||||
(if (afn structure) (next-fn structure) NONE))
|
||||
(transform* [this structure next-fn]
|
||||
(if (afn structure) (next-fn structure) structure))
|
||||
)
|
||||
|
||||
(extend-type nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue