Any good reason for Ruby to have == AND eql? ? (similarly with to_a and to_ary)
问题 I know eql? is used by Hashes to see if an object matches a key * , and you do def ==(rb) if you want to support the == operator, but there must be a good reason that Hashes don't use == instead. Why is that? When are you going to have definitions for == and eql? that are not equivalent (e.g. one is an alias to the other) ? Similarly, why have to_ary in addition to to_a? This question came up in response to an answer someone gave me on another question. * Of course, a Hash also assumes eql? =