Luciano Ramalho wrote:

> I was just wondering whether there is a way, via introspection, to
> fetch that list programmatically from Ruby, short of inspecting the
> source code for the interpreter.

More or less.

  h = []
  ObjectSpace.each_object(Class){|c|
    h |= c.public_instance_methods.select{|m| m =~ /^\W/}
    h |= c.private_instance_methods.select{|m| m =~ /^\W/}
  }
  ObjectSpace.each_object(Module){|c|
    h |= c.public_instance_methods.select{|m| m =~ /^\W/}
    h |= c.private_instance_methods.select{|m| m =~ /^\W/}
  }
  p h

There's probably some clever way to compute precedence too.

T.