From: "David A. Black" Date: 2004-09-28T09:37:23+09:00 Subject: Re: Best name for "this method" ? Hi -- On Tue, 28 Sep 2004 Ara.T.Howard@noaa.gov wrote: > 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? > > > > Thanks, > > T. > > in C this is known as __FUNCTION__. so perhaps 'function'. this could be > o.k. if it were a method of Binding => Binding#function Hmmmm... then we'd have proc, Proc, lambda, block, closure, method, *and* function :-) David -- David A. Black dblack@wobblini.net