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

For languages that have strict distinction between booleans and integers (or other non-logical types) there is the natural priority of operations:

1) algebraic

2) relational

3) logical

From this, bitwise & and | are algebraic, so they should have higher priority than relationals.

One problem is !, which as a logical operator should have much lower priority.

Another problem is ==, which could be interpreted as both relational (when used on integers) or logical when used on booleans).



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

Search: