From: Trans Date: 2006-12-22T09:43:35+09:00 Subject: Re: Method named ***(other) Luciano Ramalho wrote: > Thanks, T. That was awesome! > > By why did you say "more or less"? Do you think your code could be > missing something? > > Cheers, > > Luciano > > On 12/21/06, Trans wrote: > > 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. +@ and -@ are prefix operators, so you may not want those. And [] and []= are a special in theie own way as well. So that's the possible "more". As for "less", there may be an operator or two that is legal but is not defined anywhere in the core set of classes/modules --though unlikely, I did not check to make sure all where accounted. T.