(p-> x & forms)
Like ->
but meant to be used where the initial expression evaluates to a proto-map. Under the hood, p->
will operate on a transient version of the proto-map and persistent!
it back when done. Expressions will be pipelined as much as possible (but never reordered) such that (p-> person-proto (assoc-in [:pet :name] "patch") (assoc-in [:pet :kind] :cat))
will only generate a single instance of a pet transient map to which both operations will be applied in succession.
Like `->` but meant to be used where the initial expression evaluates to a proto-map. Under the hood, `p->` will operate on a transient version of the proto-map and `persistent!` it back when done. Expressions will be pipelined as much as possible (but never reordered) such that `(p-> person-proto (assoc-in [:pet :name] "patch") (assoc-in [:pet :kind] :cat))` will only generate a single instance of a pet transient map to which both operations will be applied in succession.
(pcond-> expr & clauses)
Equivalent to cond->. See p->
Equivalent to cond->. See `p->`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close