3 ms·
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 th
by eaurouge 14y 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.
- smsm42 14y ago"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.
- pacaro 14y agoIt 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)