add terminal-val
This commit is contained in:
parent
858b0b488d
commit
50d2aa48f5
1 changed files with 10 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
defnav
|
defnav
|
||||||
defpathedfn
|
defpathedfn
|
||||||
richnav
|
richnav
|
||||||
|
defnavconstructor
|
||||||
]]
|
]]
|
||||||
[com.rpl.specter.util-macros :refer
|
[com.rpl.specter.util-macros :refer
|
||||||
[doseqres]]
|
[doseqres]]
|
||||||
|
|
@ -21,7 +22,8 @@
|
||||||
defcollector
|
defcollector
|
||||||
defnav
|
defnav
|
||||||
defpathedfn
|
defpathedfn
|
||||||
richnav]]
|
richnav
|
||||||
|
defnavconstructor]]
|
||||||
#+clj [com.rpl.specter.util-macros :only [doseqres]]
|
#+clj [com.rpl.specter.util-macros :only [doseqres]]
|
||||||
)
|
)
|
||||||
(:require [com.rpl.specter.impl :as i]
|
(:require [com.rpl.specter.impl :as i]
|
||||||
|
|
@ -219,6 +221,13 @@
|
||||||
(i/terminal* params params-idx vals structure)
|
(i/terminal* params params-idx vals structure)
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
(defnavconstructor terminal-val
|
||||||
|
"Like `terminal` but specifies a val to set at the location regardless of
|
||||||
|
the collected values or the value at the location."
|
||||||
|
[p terminal]
|
||||||
|
[v]
|
||||||
|
(p (constantly v)))
|
||||||
|
|
||||||
(def
|
(def
|
||||||
^{:doc "Navigate to every element of the collection. For maps navigates to
|
^{:doc "Navigate to every element of the collection. For maps navigates to
|
||||||
a vector of `[key value]`."}
|
a vector of `[key value]`."}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue