From: "David A. Black" Date: 2005-11-18T22:56:59+09:00 Subject: Re: Method Definitions Hi -- On Fri, 18 Nov 2005, Daniel Schierbeck wrote: > David A. Black wrote: >> Hi -- >> >> On Fri, 18 Nov 2005, Daniel Schierbeck wrote: >> >>> Just a little curiosity: If method definitions (`def foo; end') were to >>> return a symbol representing the method's name (`:foo' in this case) >>> rather than just nil, would this be possible? >>> >>> class Klass >>> private def foo >>> "Klass#foo" >>> end >>> >>> def bar >>> "Klass#bar" >>> end >>> end >>> >>> obj = Klass.new >>> obj.bar -> "Klass#bar" >>> obj.foo -> private method `foo' called... >> >> Yes; I think that's one of the main things people who advocate this >> want to be able to do (just remembering [I think] from earlier >> discussions). >> >> >> David >> > > Could you point me to one of those discussions? I wonder why such a proposal > was turned down. Search for "make def return something useful" David -- David A. Black dblack@wobblini.net