logoalt Hacker News

gpderetta12/09/20241 replyview on HN

"for each hat in the set of hats I know. the statement 'the hat is green' is true"; the previous statement would be true if the set of hats I know is empty.

Incidentally, if you are a programmer it should be obvious that folding 'and' on an empty set must return True.


Replies

MrMcCall12/09/2024

Uninitialized variables are 90% of our bugs, or so I've been told.

I don't consider a boolean "and" or "or" of a list of bools to be automatically true or false of an empty set, my friend. To me, the specific case for a boolean function applied to an empty list of bools would have to be explicitly stated in the design.

Thanks for explaining how mathematicians and logicians treat the empty set. I have more pragmatic situations to address :-)

show 1 reply