Hacker News new | past | comments | ask | show | jobs | submit login

1 < 2 < 3 DOES evaluate to (1 < 2) < 3

And 1 < 2 evaluates to true. What else would it evaluate to?

That leaves (true < 3)

Which fails. This isn't a mistake by ruby. When you chain methods you have to think about what they return.

And the issue here isn't associativity.




The comment you're replying to was not asserting that Ruby fails to follow its own rules, but rather arguing with the rules Ruby follows; other languages have made an exception to their normal rules for this case, and apparently some people feel it would be better for Ruby to do the same.




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

Search: