From: Kornelius Kalnbach Date: 2009-01-31T23:59:06+09:00 Subject: [ruby-core:21694] Re: Definable != is a Bad Thing??? hello, about definable != again :) We might be using the new != operator in AmberVM, a Ruby interpreter collection. Part of the ECMA script compiler (racc): | rhs '!=' rhs { if RUBY_VERSION >= '1.9' result = meth(val[0], :'!=', val[2]) else result = meth(meth(val[0], :==, val[2]), :~) end } I use '!=' here to make it work with Ruby 1.8, too. Since the boolean classes don't define ~, I had to do it myself: if RUBY_VERSION < '1.9' && !TrueClass.instance_methods.include?('~') class TrueClass def ~; false end end class FalseClass def ~; true end end end It would actually be nice to add these methods to core Ruby 1.8, so ! can be easier simulated. [murphy]