From: Marc-Andre Lafortune Date: 2009-09-25T06:08:40+09:00 Subject: [ruby-core:25755] [Bug #1898] Method#== for Methods with the Same Body Issue #1898 has been updated by Marc-Andre Lafortune. Category changed from DOC to core Assigned to set to Yukihiro Matsumoto Priority changed from Low to Normal Target version set to 1.9.2 I think you raise a couple of interesting questions, one of which due to the recent addition of respond_to_missing? class A def f1 42 end def f2 42 end alias_method :alias_f1, :f1 define_method :defined_f1, instance_method(:f1) p = Proc.new { :bar } define_method :proc1, p define_method :proc2, p define_method :block1, &p define_method :block2, &p def respond_to_missing? method true end def method_missing method :foo end end a = A.new # I think it is clear that: a.method(:alias_f1 ) == a.method(:f1 ) # ==> true a.method(:defined_f1 ) == a.method(:f1 ) # ==> true a.method(:missing ) == a.method(:not_here) # ==> false # and, although they were defined similarly: a.method(:f2 ) == a.method(:f1 ) # ==> false # OK so far. The following currently return false, but. # it might be preferable if they returned true. What do you think? a.method(:missing ) == a.method(:missing ) # ==> ??? a.method(:proc1 ) == a.method(:proc2 ) # ==> ??? a.method(:block1 ) == a.method(:block2 ) # ==> ??? a.method(:proc1 ) == a.method(:block1 ) # ==> ??? ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1898 ---------------------------------------- http://redmine.ruby-lang.org