add terminal-val

This commit is contained in:
Nathan Marz 2016-06-22 21:00:31 -04:00
parent 858b0b488d
commit 50d2aa48f5

View file

@ -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]`."}