On Tuesday, September 28, 2004, 10:09:30 AM, David wrote:

> Hi --

> On Tue, 28 Sep 2004, trans.  (T. Onoma) wrote:

>> Wondering what the conscensus is on the best name for "this method". Right now
>> I'm using #calling, taking after #binding, but I'm not so sure about it. I've
>> also considered #this or #thus, to be more along the lines of 'self'.
>> 
>>   # Returns the current method or method name
>>   def calling(firstclass=false)
>>     m = /\`([^\']+)\'/.match(caller(1).first)[1]
>>     return ( firstclass ? method( m ) : m.intern )
>>   end
>> 
>> Also, will a method like this be implemented in future Ruby?

> If so, I hope it won't have the boolean flag.  I think those flags,
> such as instance_methods(false), etc., are the most obscure, cryptic
> thing in Ruby.  I'd like to see them disappear.  

Amen.  I can _never_ get a meaningful, predictable result out of those
damn *methods(flag) methods!  At least, not on purpose.  I've thought
more than once about writing my own set of methods to wrap those.
Pity thought hasn't become action.

Gavin