Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are a lot of three-valued logics that lots of programming languages implicitly follow by accident sometimes. For example:

  true || 3 ==3 || panic()
will, through short-circuiting, evaluate to “true” even though the final element doesn’t evaluate to either true or false.

(As you may observe, they also follow a weird logic where AND and OR are not commutative...)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: