Hi -- On Fri, 7 Jul 2006, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: About 1.9 #__method__ feature." > on Fri, 7 Jul 2006 21:30:03 +0900, dblack / wobblini.net writes: > > |> But we already have module_function, which has never been complained > |> for more than 10 years. I think it's OK to meet small confusion for > |> the first timers, if we can use the name with right mnemonic for the > |> functionality. Probably the reason behind the funcall is my Lisp > |> background. > | > |I'm not a first timer though, and I find it confusing :-) You're > |right about module_function, but it also (in my experience) doesn't > |get used much. > > I think you're still a first timer to the term "funcall" in Ruby. ;-) > Anyway, my point is whether funcall etc. would work as good mnemonic > or not, _after_ users get used to them. > > |The functionality we're talking about, as I understand it, is: send a > |message to an object, with the stipulation that the object treat the > |message indifferently with respect to the access level of the method > |(if any) that corresponds to the message. > > Right, if I understand the work stipulation correctly. Basically a condition imposed. > |To me, that leads to things like send! or absolute_send or inner_send > |or instance_send (which I think Sean O'Halpin just suggested). It's > |still basically a "send" operation. > | > |The part I don't understand is why the inclusion of private methods > |suddenly makes it something other than a "send" -- why it requires a > |(basically) new concept, the concept of objects having "functions" and > |responding directly to "call" requests. > > "send" and "funcall" are both taken from lisp function names; "send" > invokes a method; "funcall" invokes a function. In Ruby, "send" > invokes a method; "funcall" invokes a method in functional style. Then it's not really taken from Lisp :-) > They are short names for mnemonic. There should be official, longer > orthogonal, and exact names for the functionality. I proposed > "invoke_method" and "invoke_functional_method", but they are not final > decision. I'm probably going in circles, but I'm not seeing a functional-style method call here: obj.funcall(:meth) funcall itself isn't being called functionally, and meth isn't being called at all -- that is, you don't see this in the program: meth and therefore it's impossible, I think, to talk about the "style" of the "method invocation". If I'm not convincing you, maybe I can suggest: invoke_method_functionally instead of invoke_functional_method. I honestly don't think either of them is perfect, but it would be probably be better not to introduce the separate notion of a "functional method", since the *same* method can be invoked in different ways. David -- "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!