有条不紊地将键值放入映射中,有哪些简洁的方法?

Ser*_*gey 9 clojure

什么是简洁/优雅的方式放入相应条件为真的地图键值对?

那是翻译

[condition1 condition2 ...] [key1 val1 key2 val2 ...]
Run Code Online (Sandbox Code Playgroud)

要么

[condition1 condition2 ...] [key1 key2 ...] [val1 val2 ...]
Run Code Online (Sandbox Code Playgroud)

要么

[condition1 key1 val1 condition2 key2 val2...]
Run Code Online (Sandbox Code Playgroud)

{key-for-true-condition1 val-for-true-condition1, key-for-true-condition2 val-for-true-condition2...}
Run Code Online (Sandbox Code Playgroud)

我认为在其lambda中使用"if"和"if"但是对更简洁/美丽/优雅/惯用的方式感兴趣.

nic*_*kik 6

(into {} (for [[c k v] (partition 3 coll) :when c] 
    [k v])) 
Run Code Online (Sandbox Code Playgroud)

基于金太郎的'for'版本,但更短.