“和”似乎是一个宏,所以我不能在(reduce and list-of-booleans)
我该怎么办?
答案 0 :(得分:4)
你可以把它包装成像这样的lambda。
user=> (reduce (fn [a b] (and a b)) '(true true true))
true
user=> (reduce (fn [a b] (and a b)) '(true true false))
false
当然,你根本不需要减少,你必须使用每一个?:
user=> (every? true? '(true false true))
false