module ComparisonChainable
def self.append_features(mod)
mod.module_eval do
alias lt < ; def <(x) lt(x) && x end
alias gt > ; def >(x) gt(x) && x end
#ailas le <= ; def <=(x) le(x) && x end
alias ge >= ; def >=(x) ge(x) && x end
alias eq == ; def ==(x) eq(x) && x end end end end
class FalseClass
def <(x)false end; def >(x)false end; def <=(x)false end; def >=(x)false end
end
[Fixnum, Bignum, Float, String, Module].each do |k|
k.class_eval do include ComparisonChainable end end

p 1<2<3
p 1<2<2

文法スレ読んでてこういうの考えたんだけど、
コメントアウト外すと parse error になるのはバグ?