From: Ammar Ali Date: 2010-10-18T03:42:07+09:00 Subject: Re: Is it possible to find out if an identifier is a method alias? On Sat, Oct 16, 2010 at 4:19 PM, David A. Black wrote: > I could be wrong, and haven't dug into the code, but I've always had the > impression that (by design) there's no difference between different ways > to refer to a method. It's not that the alias is a kind of nickname for > the "real" name; it *is* (one of) the real name(s). You inspired me to take a look and you are right on. alias just creates a new entry for the same method into the target's method table. There is nothing in the entry that distinguishes it as an alias. > In 1.9.2, anyway, #instance_methods seems to list methods in the order > they were created/aliased, though I don't know whether this is > guaranteed: The methods are always copied in the order they were defined (using rb_ary_push). I guess that's guaranteed enough for a hack. Based on the equality Daniel pointed out and the ordering you did, I took a jab at it: http://gist.github.com/631102 Thanks, Ammar