From: Jeff Storey Date: 2012-06-28T22:36:34+09:00 Subject: Confusion about aliasing eql? and == I'm new to ruby and have some confusion about the eql? and == methods. I understand that eql? compares value and type, while == just compares values, but the ruby documentation states: For objects of class Object, eql? is synonymous with ==. Subclasses normally continue this tradition, but there are exceptions. It does not seem like this is the implemented behavior of Object, but rather a suggestion. The object.c source code for ruby states Subclasses normally continue this tradition by aliasing eql? to their overridden == method, but there are exceptions So my question is - is it typical to just alias :eql? :== in classes when overriding == and have == check both type and value? If this is the common case, I would think there is an easier way to do this rather than adding an alias to every file where you override ==. Thanks, Jeff -- Posted via http://www.ruby-forum.com/.