Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 542 Bytes

cond-GTGT.md

File metadata and controls

30 lines (23 loc) · 542 Bytes
name see also
cljs.core/cond->>
cljs.core/->
cljs.core/->>
cljs.core/cond->
cljs.core/cond

Summary

Details

Takes an expression and a set of test/form pairs. Threads expr (via ->>) through each form for which the corresponding test expression is true.

Note that, unlike cond branching, cond->> threading does not short circuit after the first true test expression.

Examples

(def filter? true)
(def sum? true)

(cond->> [1 2 3 4]
  filter? (filter even?)
  sum?    (reduce +))
;;=> 6