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
|
||||
defpathedfn
|
||||
richnav
|
||||
defnavconstructor
|
||||
]]
|
||||
[com.rpl.specter.util-macros :refer
|
||||
[doseqres]]
|
||||
|
|
@ -21,7 +22,8 @@
|
|||
defcollector
|
||||
defnav
|
||||
defpathedfn
|
||||
richnav]]
|
||||
richnav
|
||||
defnavconstructor]]
|
||||
#+clj [com.rpl.specter.util-macros :only [doseqres]]
|
||||
)
|
||||
(:require [com.rpl.specter.impl :as i]
|
||||
|
|
@ -219,6 +221,13 @@
|
|||
(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
|
||||
^{:doc "Navigate to every element of the collection. For maps navigates to
|
||||
a vector of `[key value]`."}
|
||||
|
|
|
|||
Loading…
Reference in a new issue