Actions
Feature #5899
closed
Actions
Added by neleai (Ondrej Bilka) over 14 years ago. Updated about 10 years ago.
Description
Ondrej Bilka wrote in post #1041080:
Issue #5899 has been reported by Ondrej Bilka.
Feature #5899: chaining comparsions.
https://bugs.ruby-lang.org/issues/5899puts "yes" if 1<2<3<4
+1
--
Posted via http://www.ruby-forum.com/.
I don't think changing "1 < b < 4" to "1 < b && b < 4" is that hard task.
I am not sure it's worth allowing confusing "false < 4".
Matz.
Yukihiro Matsumoto wrote:
I don't think changing "
1 < b < 4" to "1 < b && b < 4" is that hard task.
Writing 1 < b && b < 4 is not hard. But doesn't 1 < b < 4 look intriguing? It's so clean!
I would also expect a slight difference, namely that 1 < b < 4 evaluates b once and 1 < b && b < 4 evaluates b twice.
I don't think it's worth adding extra complexity to Ruby.
Matz.