Hacker News new | ask | show | jobs
by eaurouge 4852 days ago
Makes for an interesting blog post, I guess. But precedence for "&&" and "||" in Ruby are similar to precedence for "&&" and "||" in C, Java and others, and they are similar to precedence rules for "and" and "or" in Python. Precedence rules for "and" and "or" in Ruby are an anomaly not just in the Ruby world but in many (most?) mainstream languages.
2 comments

"In many (most?) mainstream languages" doesn't really agree with "anomaly". If it's in most mainstream languages, then it's not an anomaly, it's the norm.
It seems to me that Ruby's "and" and "or" are more similar to Prolog's ','/2 and ';'/2

([Edit] not that Prolog is necessary a shining example of a mainstream programming language)