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

Interesting. I'd go the other way. Continue using single-character bitwise operators, but spell out "and" and "or" for the logical operators.

Rationale: in normal usage, short-circuiting logical operators are, in effect, a special kind of control flow statement, and control flow statements are typically spelled out. Bitwise operators are more unequivocally meant for calculation, and therefore perhaps more deserving of similar syntax to the arithmetic operators, despite their less frequent usage.

I think that this way of drawing the distinction might be particularly relevant in a language that disallows conditional branching - and, by extension, short-circuiting logical operations - on certain kinds of data the way Rune does.



This is exactly what Python did and it works out very well for the most part.


Or the Pascal way. "And"/"or" for logical operators on bools. "And"/"Or" for bitwise operators on integers

With a strong type system, it knows if the input is bool or integer




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

Search: