Why should (every? string? []) yield true?

后端 未结 6 1496
说谎
说谎 2021-01-11 13:44

Looking at the source code for every? makes clear why

(every? string? []) => true

This is because every?

6条回答
  •  渐次进展
    2021-01-11 14:27

    Function every? implements the universal quantification.

    From (every? string? []) => false it would follow that [] contains an object x such that (string? x) => false (this is how negation of universal quantifier works). This leads to contradiction, so (every? string? []) must return true.

提交回复
热议问题