On Mon, 6 Dec 2004 09:39:43 +0900, Peter <Peter.Vanbroekhoven / cs.kuleuven.ac.be> wrote: > In RCR 277 it is proposed to have def return something useful, more > specifically the symbol under which the method is defined. Something like > this has been proposed/requested a few times on ruby-talk too (dating back > as far as 2001 [ruby-talk:15434]). > > At https://developer.berlios.de/project/showfiles.php?group_id=1216&release_id=4105 > you can find a patch that implements the idea but returns an UnboundMethod > instead of a symbol (or a Method when defining a singleton method). It > extends Module#public/private/protected to take a single (Unbound)?Method > as parameter. The patch is against the source of Ruby 1.8.2. > > I'm still in the dark about the true speed hit of this change, as it > actually seems to run slightly faster on my machine, or at least for the > few tests I've conducted. > > Disclaimer: the existence of this patch does not reflect whether or not > I'm in favor of actually having this in Ruby. I'm just building these > things because that is the best way for me to learn about Ruby's 'guts'. A Method still isn't good, because you can't easily get the name of the Method without calling #inspect. -austin -- Austin Ziegler * halostatue / gmail.com * Alternate: austin / halostatue.ca