From: matz@... (Yukihiro Matsumoto) Date: 2001-06-12T01:06:51+09:00 Subject: [ruby-talk:16412] Re: Method objects fail equivalence Hi, In message "[ruby-talk:16409] Re: Method objects fail equivalence" on 01/06/11, Mirian Crzig Lennox writes: |>Yes. Method objects are created each time you invoke "method". |>It's for "handling a method as an object", not for comparison. | |Okay. I thought that == was supposed to be for logical equivalence, |not necessarily "same object" equivalence? Or is that just === ? Well, == is for equivalence, which default behavior is equal identity. FYI, equal? is for "same object equivalence". Only reason why Method does not have tailored "==" method is I was not sure about the "definition of equivalence" for method objects. |Anyway, I'm thinking that maybe it would be more intuitive to have == |or === return true for two different Method objects if they both |reference the same underlying method. What do you think? Defining equivalence of method objects are probably little bit difficult than you expected (considering alias, subclass overriding, etc.), but you inspired me certain behavior. I'll try it later to see how it goes well. matz.