Hi everyone, I was reasoning about the semantic me...
# stdlib
b
Hi everyone, I was reasoning about the semantic meanining of the stdlib’s
public inline fun <T> Iterable<T>.all(predicate: (T) -> Boolean): Boolean
with my colleagues and I realized that a lot of them have different intuitive expectations about the output of the function when called on an empty list. Can someone provide some insights about the decision of make it return
true
if the list is empty? Thanks!
m
It is correct, when list is empty then all elements satisfy predicate.