4 ms·
Clojure does the same thing: > clj
by the-alchemist 3y ago
Clojure does the same thing:
> clj
Clojure 1.11.1
user=> (every? true? [])
true
user=> (every? false? [])
true
user=> (every? true? nil)
true
user=>
Also:
user=> (true? [])
false
In English, an empty list is `false`, but any predicate on an empty list is `true`.
So I believe the logic is the same as Python.
Logic article on this in Wikipedia: https://en.wikipedia.org/wiki/Vacuous_truth https://en.wikipedia.org/wiki/Vacuous_truth