From: Logan Capaldo Date: 2006-07-05T04:32:07+09:00 Subject: Re: About 1.9 #__method__ feature. On Jul 4, 2006, at 3:21 PM, dblack@wobblini.net wrote: > Hi -- > > On Wed, 5 Jul 2006, Logan Capaldo wrote: > >> >> On Jul 4, 2006, at 2:53 PM, dblack@wobblini.net wrote: >> >>> Can you show me an example? I'm still not understanding. I'm >>> thinking of: >>> >>> obj.funcall(:meth) >>> but maybe there's a different/new syntax for funcall? Is it now a >>> top-level method? >>> David >> >> meth is the "top level" method. >> >> e.g.: >> >> class A >> def initialize >> jump_up_and_down( ) # look, I'm calling a "function" (No >> explicit receiver) >> end >> private >> def jump_up_and_down( ) >> ... >> end >> end >> >> That's why top level declared methods are private. It's to >> distinguish "function" methods from method methods. Hence the name >> "funcall" (call a "function") > > I don't like it. It seems wrong to go through a non-functional style > to tell an object to call something internally in a functional style, > when in fact the "style" only referred to the lexical and > typographical convention in the first place. > > Besides, if jump_up_and_down were not private, it could still be > called with an implicit receiver in A#initialize. I don't think that > puts it in a different category of method. > > It also seems that the notion of a function (or "function method") is > emerging in Ruby as a kind of side effect of the new method names. I > don't see anything here that can't be handled thoroughly without this > notion. > > > David > Well this is basically what matz. has said before, I just put my own words to it. The function method concept didn't come from the method name, matz. named the method #funcall based on his function method concept. > -- > "To fully realize the potential of Rails, it's crucial that you take > the time to fully understand Ruby--and with "Ruby for Rails" David > has provided just what you need to help you achieve that goal." > -- DAVID HEINEMEIER HANSSON, in the foreword to RUBY FOR RAILS. > Complete foreword & sample chapters at http://www.manning.com/black! >