Remove ALL! and filterer!

This commit is contained in:
Alex Engelberg 2016-06-05 11:10:40 -07:00
parent b3e581f737
commit 067ce9edee
2 changed files with 1 additions and 22 deletions

View file

@ -797,15 +797,6 @@
structure structure
(range (count structure)))) (range (count structure))))
(deftype TransientAllNavigator [])
(extend-protocol p/Navigator
TransientAllNavigator
(select* [this structure next-fn]
(transient-all-select structure next-fn))
(transform* [this structure next-fn]
(transient-all-transform! structure next-fn)))
(defn extract-basic-filter-fn [path] (defn extract-basic-filter-fn [path]
(cond (fn? path) (cond (fn? path)
path path

View file

@ -9,7 +9,7 @@
[defnav [defnav
defpathedfn]]) defpathedfn]])
(:require [com.rpl.specter.impl :as i] (:require [com.rpl.specter.impl :as i]
[com.rpl.specter :refer [subselect]])) [com.rpl.specter :refer [subselect selected?]]))
(defnav (defnav
^{:doc "Navigates to the specified key of a transient collection, ^{:doc "Navigates to the specified key of a transient collection,
@ -33,18 +33,6 @@
"Navigates to the last element of a transient vector." "Navigates to the last element of a transient vector."
(i/comp-paths* [(i/->TransientLastNavigator)])) (i/comp-paths* [(i/->TransientLastNavigator)]))
(def ALL!
;; TODO: only works on transient vectors, not sets / maps; need a
;; different name?
"Navigates to each element of a transient vector."
(i/comp-paths* [(i/->TransientAllNavigator)]))
(defpathedfn filterer!
"Navigates to a view of the current transient vector that only
contains elements that match the given path."
[& path]
(subselect ALL! (selected? path)))
(defn- select-keys-from-transient-map (defn- select-keys-from-transient-map
"Selects keys from transient map, because built-in select-keys uses "Selects keys from transient map, because built-in select-keys uses
`find` which is unsupported." `find` which is unsupported."